Asked  7 Months ago    Answers:  5   Viewed   40 times

How would I go about pulling in tweets from multiple twitter users with PHP and displaying them as part of one combined list on my page?

 Answers

20

Use the search API and boolean OR operator. For example here is the URL for CNN Breaking News and NPR All Things Considered:

http://search.twitter.com/search.json?q=from%3acnnbrk+OR+from%3anpratc

The query is URLEncoded so use Fiddler Tools -> Text Encode/Decode or your favorite tool to see that the correct format in plain text is:

q=from:cnnbrk+OR+from:npratc

Hope that helps.

Wednesday, March 31, 2021
 
John_BSDthos
answered 7 Months ago
53

"my contact form downloads the PHP script rather than sending the email"

It sounds like PHP is either not installed/running or not properly configured.

I suggest that you create a file called test.php file with <?php echo "Hello world"; ?> inside it and see if it does the same thing.

If it still wants to appear like it wants to download, then there's the problem; PHP is not installed or not properly configured and isn't parsing PHP as it normally should.

Create another file and place <?php phpinfo(); ?> and it should show you the server's information.

Wednesday, March 31, 2021
 
maniclorn
answered 7 Months ago
74

Unfortunately after having suspicions confirmed, Facebook has killed this feature. A solution has been recommended here: https://stackoverflow.com/a/9778635/320681

Saturday, May 29, 2021
 
Corsair
answered 5 Months ago
42

Finally, I found a solution.

All you need to do is, once you get the callback, initialize the class again with new access token.

$connection = new TwitterOAuth('MY_CONSUMER_KEY', 'MY_CONSUMER_SECRET', $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);

$access_token = $connection->oauth("oauth/access_token", array("oauth_verifier" => $_REQUEST['oauth_verifier']));

$connection = new TwitterOAuth('MY_CONSUMER_KEY', 'MY_CONSUMER_SECRET', $access_token['oauth_token'], $access_token['oauth_token_secret']);

I don't know why that works, but it does work like a charm. Found this solution from here.

Saturday, May 29, 2021
 
Sidarta
answered 5 Months ago
85

Short answer: You can't do this perfectly.

Long answer: You can do this with some effort but it isn't going to be even close to perfect. You can use the twitter api to monitor the activity of up to 4000 user id's. If a tweet is created by one of the 4k people you monitor, then you can get all the information including the people who have favourited the tweet. This also requires that you push all the information about the people you monitor onto a database (I use mongodb). You can then query the database for information about your tweet.

Wednesday, October 6, 2021
 
nirvair
answered 2 Weeks ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :