andrewbiggart / latest-tweets-php-o-auth

Twitters API v1.0 has now been retired. Here's a way you can pull your tweets from Twitter using PHP and OAuth.
130 stars 43 forks source link

use the script two times #15

Closed bratgeraet closed 9 years ago

bratgeraet commented 9 years ago

I want to show two different Twitter feeds on the same page. I put the script in two different folders on the server and configered for the Twitter profiles. The server loads only one feed and show a warning message that variables already declare. My PHP skills are very low. Is it possible to run it like I want to do?

andrewbiggart commented 9 years ago

Hi Bratgeraet,

You don't need to create two different versions of the script to achieve this.

The script is a function, so can be used as many times as you like.

Simple add this line to the bottom of the tweets.php file for the second feed:

display_latest_tweets('second_twitter_account');

Andrew

bratgeraet commented 9 years ago

works great, thank you!

andrewbiggart commented 9 years ago

The only thing you need to consider, is having separate cache files for booth feeds.

bratgeraet commented 9 years ago

Now I see it works only in Firefox, not in IE. How can I set up a second cache file?

bratgeraet commented 9 years ago

ok now it seems to work. i make a copy of function display_latest_tweets and call it display_latest_tweets2 and rename all variables