Riboflavin1 Posted November 19, 2010 Share Posted November 19, 2010 Hi all, I have used this script to pull twitter updates to my website and it works great: http://www.inkplant.com/code/pull-twitter-feed-into-your-site.php I was wondering if anyone could help me modify it so that it links to the individual twitter posts such as: http://twitter.com/user/status/4528454817693440 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/219173-linking-to-individual-twitter-posts/ Share on other sites More sharing options...
upp Posted November 19, 2010 Share Posted November 19, 2010 that second link you provided didnt work, what exactly are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/219173-linking-to-individual-twitter-posts/#findComment-1136542 Share on other sites More sharing options...
Riboflavin1 Posted November 19, 2010 Author Share Posted November 19, 2010 Its just an example of a twitter post link. Each post can be viewed individually, I want to link to them individually. Quote Link to comment https://forums.phpfreaks.com/topic/219173-linking-to-individual-twitter-posts/#findComment-1136558 Share on other sites More sharing options...
salathe Posted November 19, 2010 Share Posted November 19, 2010 What specific part are you having trouble with? You store all of the necessary information to reconstruct the status URL. There are two main tasks, make a URL string and output it as a HTML link. Quote Link to comment https://forums.phpfreaks.com/topic/219173-linking-to-individual-twitter-posts/#findComment-1136559 Share on other sites More sharing options...
Riboflavin1 Posted November 19, 2010 Author Share Posted November 19, 2010 Would it be something like this then? <?php //connect to database mysql_connect("localhost", "user_twit", "password") or die(mysql_error()); //connect to specific table mysql_select_db("user_twitter") or die(mysql_error()); $result = mysql_query("SELECT * FROM `twitter` WHERE `screen_name`='username' AND `hidden` != 'y' ORDER BY `time` DESC LIMIT 3"); while ($row = mysql_fetch_array($result)) { $text = stripslashes($row['text']); $time = $row['time']; $id = $row['id']; echo "<li><a href=\"http://twitter.com/username/status/".$id."\">".$text."</a></li>\n" ; } ?> Edit: Yup, seems to be working Quote Link to comment https://forums.phpfreaks.com/topic/219173-linking-to-individual-twitter-posts/#findComment-1136566 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.