Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
cordova-twitter-client
Advanced tools
A simple, promise based twitter client for Apache Cordova that vastly simplifies interactions with the Twitter API.
A simple, promise based twitter client for Apache Cordova that vastly simplifies interactions with the Twitter API.
You should be aware that this embeds your Twitter application secrets in your cordova app. There is good discussion of this issue here.
npm i --save cordova-twitter-client
If the InAppBrowser plugin is not already installed:
cordova plugin add cordova-plugin-inappbrowser
const twitter = require('cordova-twitter-client')
const config = {
callbackUrl: '<CALLBACK_URL>',
consumerKey: '<CONSUMER_KEY>',
consumerSecret: '<CONSUMER_SECRET>',
accessToken: '<ACCESS_TOKEN>',
accessTokenSecret: '<ACCESS_TOKEN_SECRET>'
}
document.addEventListener('deviceready', onDeviceReady, false)
function onDeviceReady() {
twitter(config).login()
.then(api => api.request('statuses/user_timeline.json?screen_name=danderson00&count=20' /*, 'GET' */))
.then(results => writeToDocument(results.map(x => x.text).join('\n')))
.catch(error => writeToDocument(error.message))
function writeToDocument(text) {
const element = document.createElement('span')
element.innerText = text
document.body.appendChild(element)
}
}
You can also pass an options object:
api.request({
endpoint: 'statuses/update.json',
method: 'POST',
parameters: {
status: 'A tweet from the API!'
}
})
Or create a client from a stored token:
import { storeToken } from 'some-storage-mechanism'
twitter(config).login()
.then(({ token }) => storeToken(token))
import { retrieveToken } from 'some-storage-mechanism'
const api = twitter(config).fromToken(retrieveToken())
api.request({ /* ... */ })
FAQs
A simple, promise based twitter client for Apache Cordova that vastly simplifies interactions with the Twitter API.
We found that cordova-twitter-client 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.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.