有人用过 Twitter + OAuth 库并转发了?
我正在尝试管理这个库并想要转发消息。
该方法特别是这样的:
- (NSString *)sendRetweet: **(unsigned long)updateID**
{
if (updateID == 0){
return nil;
}
NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];
return [self _sendRequestWithMethod:HTTP_POST_METHOD pathath
queryParameters:nil body:nil
requestType:MGTwitterUpdateSendRequest
responseType:MGTwitterStatus];
}
该方法没有在库本身中实现,而是我添加的。
我不知道 updateId 是什么。我尝试使用 json 中的 id,但我不知道正确的 id 是什么..:
请参阅字典:{
contributors = "";
coordinates = "";
"created_at" = "Wed Aug 24 07:41:50 +0000 2011";
favorited = false;
geo = "";
id = **106269972766011392**;
"in_reply_to_screen_name" = "";
"in_reply_to_status_id" = "";
"in_reply_to_user_id" = "";
place = "";
"possibly_sensitive" = false;
"retweet_count" = 0;
retweeted = false;
source = "<a href=\"http://www.tweetdeck.com\" rel=\"nofollow\">TweetDeck</a>";
"source_api_request_type" = 1;
text = "Buenos d\U00edas familia! Vuelve Tom Waits... http://t.co/3fbLqbb #musica";
truncated = 0;
user = {
"contributors_enabled" = false;
"created_at" = "Tue Jan 13 14:25:32 +0000 2009";
"default_profile" = false;
"default_profile_image" = false;
description = "Twitter Oficial de Vodafone Espa\U00f1a para compartir noticias y novedades ";
"favourites_count" = 4;
"follow_request_sent" = false;
"followers_count" = 26260;
following = 1;
"friends_count" = 11928;
"geo_enabled" = false;
id = 18939115;
"is_translator" = false;
lang = en;
"listed_count" = 1429;
location = "from Madrid";
name = "vodafone_espa\U00f1a";
notifications = false;
"profile_background_color" = BADFCD;
"profile_background_image_url" = "http://a1.twimg.com/profile_background_images/303932010/twitter_ro3.jpg";
"profile_background_image_url_https" = "https://si0.twimg.com/profile_background_images/303932010/twitter_ro3.jpg";
"profile_background_tile" = false;
"profile_image_url" = "http://a1.twimg.com/profile_images/1299308789/Twitter-800x800pxNEW_normal.jpg";
"profile_image_url_https" = "https://si0.twimg.com/profile_images/1299308789/Twitter-800x800pxNEW_normal.jpg";
"profile_link_color" = FF0000;
"profile_sidebar_border_color" = F2E195;
"profile_sidebar_fill_color" = ebebeb;
"profile_text_color" = 0C3E53;
"profile_use_background_image" = true;
protected = 0;
"screen_name" = "vodafone_es";
"show_all_inline_media" = false;
"statuses_count" = 8109;
"time_zone" = Madrid;
url = "http://www.vodafone.es";
"utc_offset" = 3600;
verified = false;
};
}
看看是否有人使用此功能,我可以帮忙!
预先非常感谢您!
I'm trying to manage this library and want to make a retweet messages.
The method in particular is this:
- (NSString *)sendRetweet: **(unsigned long)updateID**
{
if (updateID == 0){
return nil;
}
NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];
return [self _sendRequestWithMethod:HTTP_POST_METHOD pathath
queryParameters:nil body:nil
requestType:MGTwitterUpdateSendRequest
responseType:MGTwitterStatus];
}
This method is not implemented in the library itself and I've added.
i don´t know what is the updateId. i try to used a id from the json but i don´t know what is the correct id..:
See dictionary: {
contributors = "";
coordinates = "";
"created_at" = "Wed Aug 24 07:41:50 +0000 2011";
favorited = false;
geo = "";
id = **106269972766011392**;
"in_reply_to_screen_name" = "";
"in_reply_to_status_id" = "";
"in_reply_to_user_id" = "";
place = "";
"possibly_sensitive" = false;
"retweet_count" = 0;
retweeted = false;
source = "<a href=\"http://www.tweetdeck.com\" rel=\"nofollow\">TweetDeck</a>";
"source_api_request_type" = 1;
text = "Buenos d\U00edas familia! Vuelve Tom Waits... http://t.co/3fbLqbb #musica";
truncated = 0;
user = {
"contributors_enabled" = false;
"created_at" = "Tue Jan 13 14:25:32 +0000 2009";
"default_profile" = false;
"default_profile_image" = false;
description = "Twitter Oficial de Vodafone Espa\U00f1a para compartir noticias y novedades ";
"favourites_count" = 4;
"follow_request_sent" = false;
"followers_count" = 26260;
following = 1;
"friends_count" = 11928;
"geo_enabled" = false;
id = 18939115;
"is_translator" = false;
lang = en;
"listed_count" = 1429;
location = "from Madrid";
name = "vodafone_espa\U00f1a";
notifications = false;
"profile_background_color" = BADFCD;
"profile_background_image_url" = "http://a1.twimg.com/profile_background_images/303932010/twitter_ro3.jpg";
"profile_background_image_url_https" = "https://si0.twimg.com/profile_background_images/303932010/twitter_ro3.jpg";
"profile_background_tile" = false;
"profile_image_url" = "http://a1.twimg.com/profile_images/1299308789/Twitter-800x800pxNEW_normal.jpg";
"profile_image_url_https" = "https://si0.twimg.com/profile_images/1299308789/Twitter-800x800pxNEW_normal.jpg";
"profile_link_color" = FF0000;
"profile_sidebar_border_color" = F2E195;
"profile_sidebar_fill_color" = ebebeb;
"profile_text_color" = 0C3E53;
"profile_use_background_image" = true;
protected = 0;
"screen_name" = "vodafone_es";
"show_all_inline_media" = false;
"statuses_count" = 8109;
"time_zone" = Madrid;
url = "http://www.vodafone.es";
"utc_offset" = 3600;
verified = false;
};
}
See if someone used this functionality and I can lend a hand!
Thank you very much in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将以下代码中的 %u 更改为 %@ 并将更新 ID 作为 NSString
传递
NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];
Twitter
中的更新 ID 早已超过了 unsigned int 最大值:-)。
此外,您还必须更新方法签名以传递字符串而不是无符号整数。
Try changing the %u in the following code to a %@ and pass update ID as NSString
NSString *path = [NSString stringWithFormat:@"statuses/retweet/%u.%@", updateID, API_FORMAT];
Update IDs in twitter have long passed unsigned int max values :-).
Also you have to update the method signature to pass string instead of unsigned int.