Strange Node.js HTTP issue

3 replies
Hello all,

Recently I programmed a javascript script that allows me to automate my following on Twitter. I did not use the Twitter API, because I apparently did too many write transactions on it. Anyways, what I did use was the cookies/headers from the developer tools and such which worked out great for a few months. However, yesterday, it gave me a 403 forbidden error from Twitter.

It is not a ban on my account or anything because I can still follow people etc. on my phone and computer. However, when I try to use the script (on my computer) it returns the error. I also tried this on a few other accounts to confirm it was the script. They also worked fine on my computer and phone, but the script returned the same error.

Also as a heads up I was not trying to abuse any rules or anything with the script (however twitter may have viewed it that way possibly).

I am using the request npm on node js to send the requests to twitter's servers. Is it possible that the request npm sends something to the server that traces it back to a node js program?

Thank you, really stumped on this one...

Resolved this issue: I missed one of the headers that the browser uses to communicate with twitters servers. If anyone else runs into this issue programming a script for twitter. Double check you have ALL headers!
#http #issue #nodejs #strange
  • Profile picture of the author Stormhashe
    Hey

    Twitter probably updated their code to prevent bots, so your script stopped working.
    {{ DiscussionBoard.errors[10336640].message }}
    • Profile picture of the author patthehat033
      Originally Posted by Stormhashe View Post

      Hey

      Twitter probably updated their code to prevent bots, so your script stopped working.
      I definitely agree with that. Do you have any ideas on how they figured out I am using Node js?
      {{ DiscussionBoard.errors[10336842].message }}
      • Profile picture of the author patthehat033
        So I tried a test on hurl.it and noticed that the user-agent contains runscope at the beginning even if I customize it, and of course I was returned 403 Forbidden on there as well. Does node do the same thing?
        {{ DiscussionBoard.errors[10336924].message }}

Trending Topics