Changeset 346dfd9 for lib


Ignore:
Timestamp:
2010-04-25T19:22:02Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b2bc25c
Parents:
da2efd4
Message:

oauth_access_token() added. I managed to increase the counter on
http://twitter.com/oauth_clients/details/127170 . \o/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/oauth.c

    rda2efd4 r346dfd9  
    253253       
    254254        oauth_params_set( &params, "oauth_version", "1.0" );
    255         oauth_params_set( &params, "oauth_callback", "oob" );
    256255       
    257256        params_s = oauth_params_string( params );
     
    281280}
    282281
    283 void oauth_request_token_done( struct http_request *req );
     282static void oauth_request_token_done( struct http_request *req );
    284283
    285284void *oauth_request_token( const char *url, oauth_cb func, void *data )
    286285{
    287286        struct oauth_info *st = g_new0( struct oauth_info, 1 );
     287        GSList *params = NULL;
    288288       
    289289        st->func = func;
    290290        st->data = data;
    291291       
     292        oauth_params_add( &params, "oauth_callback", "oob" );
     293       
    292294        return oauth_post_request( url, NULL, oauth_request_token_done, st );
    293295}
    294296
    295 void oauth_request_token_done( struct http_request *req )
     297static void oauth_request_token_done( struct http_request *req )
    296298{
    297299        struct oauth_info *st = req->data;
     
    309311        }
    310312       
    311         st->func( st );
    312 }
     313        //st->func( st );
     314}
     315
     316static void oauth_access_token_done( struct http_request *req );
     317
     318void *oauth_access_token( const char *url, const char *pin, struct oauth_info *st )
     319{
     320        GSList *params = NULL;
     321       
     322        oauth_params_add( &params, "oauth_token", st->token );
     323        oauth_params_add( &params, "oauth_verifier", pin );
     324       
     325        return oauth_post_request( url, &params, oauth_access_token_done, st );
     326}
     327
     328static void oauth_access_token_done( struct http_request *req )
     329{
     330}
Note: See TracChangeset for help on using the changeset viewer.