Comments (5)
I think it is easier to extend the settings.json
rather than creating two files. What you need is a second pair of access_token_key
and access_token_secret
. The only place where those are used is in request.js
.
Since you probably get the second access_token_key
and access_token_secret
by creating another app for your second Twitter account you get different consumer_key
and consumer_secret
for that.
So you may start with this settings.json
format where twitter_api
becomes an array and then update request.js
accordingly:
{
"twitter_api": [
{
"consumer_key": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Application Settings -> Consumer Key (API Key)",
"consumer_secret": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Application Settings -> Consumer Secret (API Secret)",
"access_token_key": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Your Access Token -> Access Token",
"access_token_secret": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Your Access Token -> Access Token Secret"
},
{
"consumer_key": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Application Settings -> Consumer Key (API Key)",
"consumer_secret": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Application Settings -> Consumer Secret (API Secret)",
"access_token_key": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Your Access Token -> Access Token",
"access_token_secret": "TODO: Set according to https://apps.twitter.com -> create app -> tab 'Keys and Access Tokens' -> Your Access Token -> Access Token Secret"
}
],
"database": {
"url": "mongodb://... TODO: See http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#the-url-connection-format",
"collection": "users"
},
"bot_parameters": {
"query": "TODO: See 'Query Operators' in https://dev.twitter.com/rest/public/search",
"lang": "en",
"replyOnceEveryXMinutes": 15,
"replyToTweetsAtLeastXMinutesOld": 5
}
}
from twitter-reply-bot.
i am sorry i don't know how to update request.js, to work with new Settings File, i have made changes to Settings.json file like the above Example. but i dont know how to change request.js file can you help me.
Thanks for Responding..
from twitter-reply-bot.
It is all about setting the credentials
variable right. Also _.random(0,1)
will be helpful. You can do it!
from twitter-reply-bot.
Sorry i dont know much about Programming. i understand, i need to change this line in requests.js
var credentials = require('../settings.json').twitter_api;
i have no idea how to do that.is there any tutorials for that part.
from twitter-reply-bot.
If you want to use custom automation like this you should definitely learn programming! Since I gave you all breadcrumbs all that is remaining is basic JavaScript programming. I encourage you to try your best!
from twitter-reply-bot.
Related Issues (4)
- some questions about this Bot HOT 23
- how do i do the query? HOT 2
- Different queries HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter-reply-bot.