Twiiter
Hi,
I Have created an application in the twitter development account.As i have started to work on my titanium to implement twitter in my mobile applications.To work on this i download two js file namely oauth.js and sha1.js.In the app.js file which is in the resource directory included the below line
var oAuthAdapter = new OAuthAdapter(
'NJQmLMLyf4TXUUab5Gf5FAOBqUn9qtgA7GMgj5Bg4',
'90u2Zo4n4D541Gtah2hjQ',
'HMAC-SHA1');
// load the access token for the service (if previously saved)
oAuthAdapter.loadAccessToken('twitter');
oAuthAdapter.send('https://api.twitter.com/1/statuses/update.json', [
['status', 'hey @ziodave, I successfully tested the #oauth adapter with #twitter and @appcelerator #titanium!']
], 'Twitter', 'Published.', 'Not published.');
// if the client is not authorized, ask for authorization.
// the previous tweet will be sent automatically after authorization
if (oAuthAdapter.isAuthorized() == false) {
// this function will be called as soon as the application is authorized
var receivePin = function() {
// get the access token with the provided pin/oauth_verifier
oAuthAdapter.getAccessToken('http://twitter.com/oauth/access_token');
// save the access token
oAuthAdapter.saveAccessToken('twitter');
};
// show the authorization UI and call back the receive PIN function
oAuthAdapter.showAuthorizeUI('http://twitter.com/oauth/authorize?oauth_token=' +
oAuthAdapter.getRequestToken('http://twitter.com/oauth/request_token', [['oauth_callback', 'oob']]),
receivePin, PinFinder.twitter);
}
To save the js and launch the application it will show the error "ReferenceError:OAuthAdapter" is not defined.
Please help me to solve the problem.
Thanks and Regards,
Venkatesan.R