Giter VIP home page Giter VIP logo

Comments (5)

analog-nico avatar analog-nico commented on July 30, 2024

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.

jessi19 avatar jessi19 commented on July 30, 2024

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.

analog-nico avatar analog-nico commented on July 30, 2024

It is all about setting the credentials variable right. Also _.random(0,1) will be helpful. You can do it!

from twitter-reply-bot.

jessi19 avatar jessi19 commented on July 30, 2024

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.

analog-nico avatar analog-nico commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.