This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
mogya/oauth-adapter
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Ti.include('lib/oauth_adapter.js'); var oAuthAdapter = new OAuthAdapter( 'YOUR CONSUMER SECRET', 'YOUR CONSUMER KEY', 'HMAC-SHA1' ); // load the access token for the service (if previously saved) oAuthAdapter.loadAccessToken('twitter'); //OAuth if need. if (oAuthAdapter.isAuthorized() == false) { var receivePin = function() { oAuthAdapter.getAccessToken('https://api.twitter.com/oauth/access_token'); oAuthAdapter.saveAccessToken('twitter'); }; // show the authorization UI and call back the receive PIN function oAuthAdapter.showAuthorizeUI('https://api.twitter.com/oauth/authorize?' + oAuthAdapter.getRequestToken('https://api.twitter.com/oauth/request_token'), receivePin); } //TWEET oAuthAdapter.send({ url:'https://api.twitter.com/1/statuses/update.json', parameters:[ ['status', '@mogyatest test from tmtwit. '+Math.random()] ], method:'POST', onSuccess:function(responce){ alert('post succeed'); } }); //get timeline oAuthAdapter.send({ url:'https://api.twitter.com/1/statuses/home_timeline.json', parameters:[ ], method:'GET', onSuccess:function(response){ alert('got tweets.see info log.'); response = JSON.parse(response); for(var i=0;i<response.length;i++){ var tweet = response[i]; Ti.API.info(tweet.user.name+':'+tweet.text); } } });
Releases
No releases published
Packages 0
No packages published