Logical help with PHP using Twitter API

Asked

Viewed 78 times

1

Well, here’s the idea, I’m using API from Twitter to authenticate users, I am using the following feature: https://twitteroauth.com.

I used this video to help me authenticate, it’s exactly the same: https://www.youtube.com/watch?v=D8pO7tbYlBk&t=32s

The logic:

All users authorizing the application, is subject to following and receiving other followers... Twitter does not provide this feature, but it is possible to do using PHP, Javascript, JSON etc....

My problem

I authenticated some users on the localhost, fake accounts, when authenticating and authorizing the application, the screen_name in a table on banco de dados, got it? I want to make like a roulette, one follows the other automatically.

OBS: I found nothing in the terms of use of Twitter saying it is forbidden. (If I am wrong correct me, please).

Help me with logic?

Summing up the question: How to return data from JSON with PHP and then use the ajax to wheel this?

  • 1

    I think my question can help you https://answall.com/questions/208247/d%C3%Bavida-sobre-api-do-twitter? Rq=1

  • I’ve seen, what I want to know, is how users follow, of course who authorize the application.

  • 1

    You can use this twitter API method https://dev.twitter.com/rest/reference/post/friendships/create

  • @gmsantos, the problem is I don’t know how to use JSON with PHP, so I asked for help with logic. If you have a simple answer but focus on the subject I will be grateful. I tried to make a method that would return the JSON in array was unsuccessful.

  • 2

    to manipulate JSON in PHP you can convert to array and vice versa. In short you will use json_encode and json_decode

  • 1

    Grata will study, if I can post the answer.

Show 1 more comment

1 answer

1


Tos from Twitter:

Following/Not following Automated Actions: You may not follow or fail to follow Twitter accounts indiscriminately or in bulk. Aggressive stalking is a violation of the Twitter Rules. Review our Follower Rules and Best Practices to ensure compliance. Remember that apps that claim to gain more followers for users are also prohibited, according to the Twitter Rules.

Source (page end)

Never surprise the users. If your app tweets to a user or performs actions such as failing to follow, a user should start this - and not be surprised.

Source

Twitter considers it spam:

[...]

  • whether you have followed and/or stopped following a large number of accounts in a short period, especially in an automated manner (following behavior aggressively or follower turnover);
  • if you follow and fail to follow people repeatedly, either to create followers or to attract more attention to your profile;

[...]

  • if you are following randomly or aggressively, bookmarking or retweeting Tweets;

[...]

  • if you create misleading accounts or account interactions;
  • if you sell or buy interactions with accounts (for example, sell or buy followers, retweets, favorites, etc.); and
  • if you promote or use third-party services or apps that claim to garner more followers for you (such as follower trains, sites that promise "more followers quickly" or any other website that offers to automatically add followers to your website account).

Source (page end)

Note that the terms can be changed frequently, the information contained here may not be updated accordingly, check the links to access the latest information. ;)


API Pública:

Oauth has an endpoint to follow other users, it is exactly:

https://api.twitter.com/1.1/friendships/create.json

According to the documentation:

Allows the authenticating users to follow the user specified in the ID Parameter.

This will be used to track other people, that you specify the ID, ie informing the person token X, that person X will follow the specified ID.


The question mentioned in the comments refers to how to log in using login/password, at least that was the question of this question, this is actually not possible using the Public API, for obvious reasons, this is explained there.

  • Hi, I’m using friendships/create but I get the following error public 'message' => string 'Cannot find specified user.' (length=27), thanks for your reply, I understood the terms differently. But I don’t think followers exchange is considered spam as long as the user knows they’re authorizing and agreeing to the terms written on my site. Do you know any other non-Abrahm authentication? I’ll be grateful if you can help me out. I’ll mark it as answered. You won’t get better answers than this. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.