MyBB Community Forums

Full Version: Post Data from Form to Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
What would I need to chmod it to?

I also renamed the arial font and now it is blank.
<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 &quot;http://twitter.com/statuses/user_timeline/.rss?count=1&quot; 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 Smile
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
$twittername = "";
hehe, well your answer is in your code.
$twittername = $_POST['twitter'];
will fix it
Current Code:
<?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.
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