Hello everyone,
I am a student who is working on a class project. We are designing a website where a use can make stock analysis. Like every stock website we wanted to have a section where the viewer can see news, and since tweeter is a great source we decided use it. I watched a tutorial on youtube everything worked fine, however, the page only show once. When I upload the files it works again, but once.
How may I change this?
I used Abrahams OAuth folder. I did not use everything file that was in that folder, just the twitteroauth.php and oauth.php. I added the destroy_session(); in my code:
<?php
include('./connect.php');
$UN = 'gokt3ngri'; $cnt = 5;
$tweets = $twitter->get('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name='.$UN.'&count='.$cnt.'');
foreach ( $tweets as $tweet )
{
$text = $tweet->text;
echo $text;
echo '';
echo '';
}
session_destory();
?>
Any help is much appreciated!
Also, is there a way to count the number of tweets? For example, I want to count how many times #CNN was tweeted in a day or given period?
Thanks so much everyone!