2010-04-10, 08:08 PM
Pages: 1 2
2010-04-10, 09:57 PM
<br />
<b>Warning</b>: simplexml_load_file(http://twitter.com/statuses/user_timeline/.rss?count=1) [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/home/chasingu/public_html/dynamicsignatures.co.cc/twitter.php</b> on line <b>9</b><br />
<br />
<b>Warning</b>: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: I/O warning : failed to load external entity "http://twitter.com/statuses/user_timeline/.rss?count=1" in <b>/home/chasingu/public_html/dynamicsignatures.co.cc/twitter.php</b> on line <b>9</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/chasingu/public_html/dynamicsignatures.co.cc/twitter.php:9) in <b>/home/chasingu/public_html/dynamicsignatures.co.cc/twitter.php</b> on line <b>40</b><br />
Basically, you got a 404 on the twitter page.In other words, the twitter feed URL is expired. Try to find the updated one
2010-04-10, 09:59 PM
Well, that is not working because you didn't enter a username.
Its looking for http://twitter.com/statuses/user_timeline/.rss?count=1
Not http://twitter.com/statuses/user_timelin...ss?count=1
Its looking for http://twitter.com/statuses/user_timeline/.rss?count=1
Not http://twitter.com/statuses/user_timelin...ss?count=1
2010-04-10, 10:05 PM
$twittername = "";
hehe, well your answer is in your code.
$twittername = $_POST['twitter'];
will fix it
hehe, well your answer is in your code.
$twittername = $_POST['twitter'];
will fix it
2010-04-10, 10:32 PM
Current Code:
Anyone? I am completely stumped.
<?php
// Your Twitter username.
$twittername = $_POST['twitter'];
// ----------------------------------------------------------------------------------
// DO NOT EDIT BEYOND THIS POINT! (unless you know what you're doing) ---------------
// ----------------------------------------------------------------------------------
$xml = simplexml_load_file("http://twitter.com/statuses/user_timeline/".$twittername.".rss?count=1");
$updated = strtotime($xml->channel->item->pubDate);
$updated = date("M d, Y, h:i a", $updated);
$tweet = str_replace($twittername.": ", "", $xml->channel->item->description);
$t = wordwrap($tweet, 60, "|");
$output = explode("|", $t);
// create image
$im = imagecreatefromjpeg("twitter.jpg");
// The color of your twitter username.
$username_color = imagecolorallocate($im, 180, 0, 0);
// The color of the date.
$date_color = imagecolorallocate($im, 120, 120, 120);
// The color of your tweet.
$tweet_color = imagecolorallocate($im, 0, 0, 0);
// Font to use.
$font = "arial.ttf";
imagettftext($im, 10, 0, 90, 18, $username_color, $font, $twittername);
imagettftext($im, 10, 0, 250, 18, $date_color, $font, $updated);
$y = 25; // Y position of the first line of your tweet.
foreach($output as $text) {
$y = $y + 15;
imagettftext($im, 10, 0, 10, $y, $tweet_color, $font, $text);
}
// output the image
header("Content-type: image/png");
imagepng($im, '{$twittername}.png');
?>
It still isn't working.Anyone? I am completely stumped.
2010-04-17, 01:36 AM
I have made it work, all I need to do is redirect everything. I do have a question though, when it makes the image for the people, does it refresh by itself?
Pages: 1 2