mirror of
https://github.com/thewesker/bug-em.git
synced 2025-12-21 20:41:05 -05:00
lol
This commit is contained in:
1
node_modules/twauth/.npmignore
generated
vendored
Normal file
1
node_modules/twauth/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
18
node_modules/twauth/README.md
generated
vendored
Normal file
18
node_modules/twauth/README.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# twauth
|
||||
Simple tool to authenticate your Twitter account with Twitter through your own API keys.
|
||||
|
||||
```
|
||||
$ npm install -g twauth
|
||||
/usr/local/bin/twauth -> /usr/local/lib/node_modules/twauth/index.js
|
||||
|
||||
$ twauth --help
|
||||
Usage: --key=[consumer key] -secret=[consumer secret]
|
||||
|
||||
Options:
|
||||
--key [required]
|
||||
--secret [required]
|
||||
```
|
||||
|
||||
Based on [a gist](https://gist.github.com/tanepiper/575303) by tanepiper.
|
||||
|
||||
Licensed under [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).
|
||||
59
node_modules/twauth/index.js
generated
vendored
Normal file
59
node_modules/twauth/index.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env node
|
||||
/*!
|
||||
* From https://gist.github.com/tanepiper/575303
|
||||
*/
|
||||
|
||||
var argv = require('optimist')
|
||||
.usage('Usage: --key=[consumer key] -secret=[consumer secret]')
|
||||
.demand(['key', 'secret'])
|
||||
.argv;
|
||||
|
||||
var OAuth = require('oauth').OAuth;
|
||||
var colors = require('colors');
|
||||
|
||||
const REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token';
|
||||
const ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token';
|
||||
const OAUTH_VERSION = '1.0';
|
||||
const HASH_VERSION = 'HMAC-SHA1';
|
||||
|
||||
function getAccessToken(oa, oauth_token, oauth_token_secret, pin) {
|
||||
oa.getOAuthAccessToken(oauth_token, oauth_token_secret, pin,
|
||||
function(error, oauth_access_token, oauth_access_token_secret, results2) {
|
||||
if (error) {
|
||||
if (parseInt(error.statusCode) == 401) {
|
||||
throw new Error('The pin number you have entered is incorrect'.bold.red);
|
||||
}
|
||||
}
|
||||
console.log('Your OAuth Access Token: '.bold.green + oauth_access_token);
|
||||
console.log('Your OAuth Token Secret: '.bold.green + oauth_access_token_secret);
|
||||
console.log('Now, save these two values, along with your origional consumer secret and key and use these in your twitter app'.bold.yellow);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
function getRequestToken(oa) {
|
||||
|
||||
oa.getOAuthRequestToken(function(error, oauth_token, oauth_token_secret, results){
|
||||
if (error) {
|
||||
throw new Error(([ error.statusCode, error.data ].join(': ')).bold.red);
|
||||
} else {
|
||||
console.log('In your browser, log in to your twitter account. Then visit:');
|
||||
console.log(('https://twitter.com/oauth/authorize?oauth_token=' + oauth_token).underline.cyan);
|
||||
console.log('After logged in, you will be promoted with a pin number.');
|
||||
console.log('');
|
||||
console.log('Enter the pin number here:'.bold.green);
|
||||
|
||||
var stdin = process.openStdin();
|
||||
stdin.on('data', function(chunk) {
|
||||
pin = chunk.toString().trim();
|
||||
getAccessToken(oa, oauth_token, oauth_token_secret, pin);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var key = argv.key.trim();
|
||||
var secret = argv.secret.trim();
|
||||
var oa = new OAuth(REQUEST_TOKEN_URL, ACCESS_TOKEN_URL, key, secret, OAUTH_VERSION, null, HASH_VERSION);
|
||||
getRequestToken(oa);
|
||||
101
node_modules/twauth/package.json
generated
vendored
Normal file
101
node_modules/twauth/package.json
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"name": "twauth",
|
||||
"raw": "twauth",
|
||||
"rawSpec": "",
|
||||
"scope": null,
|
||||
"spec": "latest",
|
||||
"type": "tag"
|
||||
},
|
||||
"C:\\Users\\talor\\bots\\polibug"
|
||||
]
|
||||
],
|
||||
"_from": "twauth@latest",
|
||||
"_id": "twauth@1.0.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/twauth",
|
||||
"_nodeVersion": "0.10.36",
|
||||
"_npmUser": {
|
||||
"email": "adam@hbang.ws",
|
||||
"name": "kirb"
|
||||
},
|
||||
"_npmVersion": "2.3.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "twauth",
|
||||
"raw": "twauth",
|
||||
"rawSpec": "",
|
||||
"scope": null,
|
||||
"spec": "latest",
|
||||
"type": "tag"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/twauth/-/twauth-1.0.1.tgz",
|
||||
"_shasum": "28d1201017efe783b27fa1ac78c7368da4226ae9",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "twauth",
|
||||
"_where": "C:\\Users\\talor\\bots\\polibug",
|
||||
"author": {
|
||||
"name": "Adam D",
|
||||
"url": "kirb"
|
||||
},
|
||||
"bin": {
|
||||
"twauth": "index.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/hbang/twauth/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Adam D",
|
||||
"url": "kirb"
|
||||
},
|
||||
{
|
||||
"name": "Tane Piper"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"colors": "^1.0.3",
|
||||
"oauth": "^0.9.12",
|
||||
"optimist": "^0.6.1"
|
||||
},
|
||||
"description": "Simple script to authenticate to Twitter",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "28d1201017efe783b27fa1ac78c7368da4226ae9",
|
||||
"tarball": "https://registry.npmjs.org/twauth/-/twauth-1.0.1.tgz"
|
||||
},
|
||||
"gitHead": "9e21efc9fa08f8a60b390d802f59a5cc22f685ae",
|
||||
"homepage": "https://github.com/hbang/twauth",
|
||||
"keywords": [
|
||||
"twitter",
|
||||
"authentication",
|
||||
"oauth",
|
||||
"auth",
|
||||
"login"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "adam@hbang.ws",
|
||||
"name": "kirb"
|
||||
}
|
||||
],
|
||||
"name": "twauth",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/hbang/twauth.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "1.0.1"
|
||||
}
|
||||
Reference in New Issue
Block a user