Last active
August 29, 2015 14:14
-
-
Save masawada/7b89907c900e5e87994f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var violet = new Violet({ | |
consumerKey: CONSUMER_KEY, | |
consumerSecret: CONSUMER_SECRET | |
}); | |
violet.accounts.add( | |
USER_ID, | |
SCREEN_NAME, | |
ACCESS_TOKEN, | |
ACCESS_TOKEN_SECRET | |
); | |
// start user stream | |
violet.streaming.on('tweet', function(accountId, streamType, tweet) { | |
console.log(tweet); | |
}); | |
violet.streaming.startUserStream(); | |
// dispatch rest response events | |
violet.rest.statuses.update.on('success',function(res){console.log(res);}); | |
violet.rest.statuses.retweet.on('success',function(res){console.log(res);}); | |
violet.rest.favorites.create.on('success',function(res){console.log(res);}); | |
violet.rest.favorites.destroy.on('success',function(res){console.log(res);}); | |
/* | |
usage: | |
violet.rest.statuses.update({status: "hogehoge"}); | |
violet.rest.statuses.retweet({id: TWEET_ID}); | |
violet.rest.favorites.create({id: TWEET_ID}); | |
violet.rest.favorites.destroy({id: TWEET_ID}); | |
*/ | |
/* | |
if you want to obtain accessToken & accessTokenSecret, use `requestAuthorizeURI` method. | |
violet.accounts.requestAuthorizeURI() | |
.then(function(res) { | |
console.log(res); | |
}); | |
violet.accounts.addWithPIN(PIN); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src="lib/main.js"></script> | |
<script src="lib/util.js"></script> | |
<script src="lib/tweet.js"></script> | |
<script src="lib/user.js"></script> | |
<script src="lib/http.js"></script> | |
<script src="lib/oauth.js"></script> | |
<script src="lib/accounts.js"></script> | |
<script src="lib/streaming/streaming.js"></script> | |
<script src="lib/streaming/message_parser.js"></script> | |
<script src="lib/streaming/event.js"></script> | |
<script src="lib/rest/request.js"></script> | |
<script src="lib/rest/rest.js"></script> | |
<script src="lib/rest/statuses.js"></script> | |
<script src="lib/rest/favorites.js"></script> | |
<script src="lib/vendor/crypto-js/src/core.js"></script> | |
<script src="lib/vendor/crypto-js/src/sha1.js"></script> | |
<script src="lib/vendor/crypto-js/src/hmac.js"></script> | |
<script src="lib/vendor/crypto-js/src/enc-base64.js"></script> | |
<script src="app.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "CUI Twitter Client", | |
"description": "CUI Twitter Client", | |
"launch_path": "/index.html", | |
"icons": { | |
"128": "/icon128.png" | |
}, | |
"orientation": "portrait", | |
"type": "privileged", | |
"permissions": { | |
"systemXHR": {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment