
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
twittercordovaplugin
Advanced tools
An Apache Cordova plugin for the Twitter Streaming API. Currently only works for Android.
This is a quick Apache Cordova plugin to use the Twitter Streaming APIs within a hybrid mobile application. It uses the twitter4J Java code
Dependencies are installed automatically. There are no configuration steps that are required by the user.
#Supported Platforms
This Cordova plugin only works for Android at this time
#Installing Install with Cordova CLI
$ cd /path/to/your/project $ cordova plugin add com.lisaseacat.twitter
Intialize the metawear device.
twitter.init(successCallback, failureCallback, oauthconsumerkey, oauthconsumersecret, callbackURL);
Function 'init' initializes the twitter streaming service. This method attempts to connect to twitter. It uses the inappbrowser plugin to ask the user to authorize the app to use Twitter. On successful authorization it will automatically start listening for tweets with a specific hashtag. The success callback is called when a new tweet is found matching the keyword. To set the keyword use the sethashtag method. You will need to setup a Twitter app at https://apps.twitter.com/.
twitter.stopTwitterStream(successCallback, failureCallback)
Function 'stopTwitterStream' tells the twitter stream to stop listening. To start it back up after it has been stopped you'll have to call init again.
twitter.addHashtag(successCallback, failureCallback, keyword, reset)
Function 'setHashTag' tells the twitter stream which keyword to listen for.
twitter.getHashtag_NoStream(successCallback, failureCallback)
Function 'getHashtag_NoStream' lets you retrieve hashtags from Twitter without using the streaming service. There is a rate limit set by Twitter to use this method..
twitter.getHomeTimeline_NoStream(successCallback, failureCallback)
Function 'getHomeTimeline_NoStream' lets you retrieve the home timeline from Twitter without using the streaming service. There is a rate limit set by Twitter to use this method..
twitter.getMentions_NoStream(successCallback, failureCallback)
Function 'getMentions_NoStream' lets you retrieve hashtags from Twitter without using the streaming service. There is a rate limit set by Twitter to use this method..
var streamtweet = {
consumerKey: '__replaceMe__',
consumerSecret: '__replaceMe__',
callbackUrl: '__replaceMe__',
start: function() {
console.log('streamtweet start! ');
twitter.init(streamtweet.tweetreceived, streamtweet.tweetfailed, streamtweet.consumerKey,streamtweet.consumerSecret,streamtweet.callbackUrl, 'LisaSeacat');
},
tweetreceived: function(data){
console.log('SUCCESSFULLY got some streaming tweets: ' + JSON.stringify(data));
}, tweetfailed: function(data){
console.log('FAILED to get the tweets: ' + JSON.stringify(data));
}, tweetStopWin: function(data){
console.log('SUCCESSFULLY stopped getting tweets: ' + JSON.stringify(data));
}, tweetStopFail: function(data){
console.log('FAILED to stop the tweet stream: ' + JSON.stringify(data));
}, stop: function(){
twitter.stopTwitterStream(streamtweet.tweetStopWin, streamtweet.tweetStopFail);
}
};
FAQs
An Apache Cordova plugin for the Twitter Streaming API. Currently only works for Android.
We found that twittercordovaplugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.