59861

Accepting Twitter friendship request using accept.json

Question:

Has anyone successfully automated and accepted friendship request on their twitter account without the need to click the accept button manually?

I am trying to automatically accept friendship requests for my restricted twitter account. I realize that the Twitter API call to <em>/friendships/accept.json</em> is restricted and I keep getting a 401 unauthorized access error.

I have tried to obtain the post_authenticity_token value using various methods to then used it in the POST parameters sent to the accept.json request as mentioned in the following post: <a href="https://stackoverflow.com/questions/5271340/twitter-api-allow-accept-request-to-follow-authenticated-user" rel="nofollow">Twitter API: Allow accept request to follow authenticated user</a>

but it keeps failing every time. Any insight or suggestion will be greatly appreciated.

Answer1:

Don't use post_authenticity_token. You are essentially screen scraping which is fragile, against their TOS, and not working. Instead use the standard <a href="https://dev.twitter.com/pages/auth" rel="nofollow">OAuth authentication</a> method their API officially supports.

Recommend

  • What's the best way to event handle dynamically created HTML? [duplicate]
  • Twitter API: how to know what application was used to follow
  • Nested models testing : Could not find table '*' Error.
  • How do I use the Twitter API to approve a follower request for a protected account?
  • line and string position of grep match
  • Aurelia validation: applying some rule on change and some on blur on same property
  • Set default application configs for Elixir packages
  • If statements in .htaccess files, to enable password protection when in specific directory only
  • mysql user row level access
  • BlueBird Promises returns “Undefined” when return inside “then” function
  • Unable to authenticate with omniauth-instagram, client_id missing
  • How can I find the Size of some specified files?
  • Android LinearLayout and Images
  • Variant of defaultdict for assigning value only once
  • Converting a data frame into named object in R
  • jQuery-Marquee only working in Firefox
  • link library to all targets in cmake project
  • How do display a UIAlertView from a block on iOS?
  • How can i compile & run a c program (with OpenMP) in gem5 Full System?
  • How to move axis labels automatically in rgl R
  • How to reply a tweet using the Twitter gem?
  • How to use function wrapper in mustache.php?
  • Adjust width of select element according to selected option's width
  • iOS: Detect app start via notification press
  • How to attach a node.js readable stream to a Sendgrid email?
  • Retrieving value from sql ExecuteScalar()
  • Hazelcast - OperationTimeoutException
  • RestKit - RKRequestDelegate does not exist
  • Is there a mandatory requirement to switch app.yaml?
  • Revoking OAuth Access Token Results in 404 Not Found
  • Load html files in TinyMce
  • Hits per day in Google Big Query
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • Change div Background jquery
  • How does Linux kernel interrupt the application?
  • Linking SubReports Without LinkChild/LinkMaster
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Busy indicator not showing up in wpf window [duplicate]
  • Why do underscore prefixed variables exist?
  • playing video using jmf