mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
http/fetch: call callback even if status is not OK so errors can be handled; surf: added back dest param for cmd()
This commit is contained in:
parent
7d715092c1
commit
c6264e1087
4 changed files with 35 additions and 27 deletions
|
@ -1,4 +1,5 @@
|
|||
/* twitter client
|
||||
* http://apiwiki.twitter.com/Twitter-API-Documentation
|
||||
*
|
||||
* - register @ http://twitter.com/apps
|
||||
* - settings:
|
||||
|
@ -23,8 +24,10 @@ object load(object usr, string key, string secret, string request, string access
|
|||
return ::load(usr, key, secret, request, access, authorize);
|
||||
}
|
||||
|
||||
void parse_status_update(string body, string headers) {
|
||||
P3(("twitter/client:parse_status_update(%O, %O)\n", body, headers))
|
||||
void parse_status_update(string body, string headers, int http_status) {
|
||||
P3(("twitter/client:parse_status_update(%O, %O, %O)\n", body, headers, http_status))
|
||||
if (http_status != R_OK)
|
||||
sendmsg(user, "_error_twitter_status_update", "Error: failed to post status update on twitter.");
|
||||
}
|
||||
|
||||
void status_update(string text) {
|
||||
|
@ -36,8 +39,8 @@ void status_update(string text) {
|
|||
fetch(ua, "http://api.twitter.com/1/statuses/update.json", "POST", (["status": text]));
|
||||
}
|
||||
|
||||
void parse_home_timeline(string body, string headers) {
|
||||
P3(("twitter/client:parse_home_timeline(%O, %O)\n", body, headers))
|
||||
void parse_home_timeline(string body, string headers, int http_status) {
|
||||
P3(("twitter/client:parse_home_timeline(%O, %O, %O)\n", body, headers, http_status))
|
||||
}
|
||||
|
||||
void home_timeline() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue