Endless Paradigm

Full Version: Twitter - Anyone use it?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
camera,, cannon?
Nope i prefer facebook it's the bomb!
And i am the terrorist (love that simile/metaphor i really don't feel like looking at keywords at the moment)
twit twit? ehhh i thought i thaw a puttycat..

well i still prefer facebook, lol, or friendster in asian countries
matchung Wrote:anyone know any php scripts can retrieve twitter contents then put on our own host?

twitter is quite slow response from my side..
http://twitter.com/matchung
What exactly do you want to retrieve? I can write up a quick script
Mickey Wrote:
matchung Wrote:anyone know any php scripts can retrieve twitter contents then put on our own host?

twitter is quite slow response from my side..
http://twitter.com/matchung
What exactly do you want to retrieve? I can write up a quick script

Flatterd nice, just want to retrieve my twitter contents then put into a consolidated page, then i use it as my home page

Strict Standards: Only variables should be passed by reference in /var/www/endlessparadigm/forum/inc/highlighter.php(1007) : regexp code on line 3

Strict Standards: Only variables should be passed by reference in /var/www/endlessparadigm/forum/inc/highlighter.php(1007) : regexp code on line 5

Strict Standards: Only variables should be passed by reference in /var/www/endlessparadigm/forum/inc/highlighter.php(1007) : regexp code on line 5
What i used

PHP Code:
<html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" /> 
</head>

<body>
<?php
function twitter_status($twitter_id, $hyperlinks = true) {
    $c = curl_init();
    curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1");
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    $src = curl_exec($c);
    curl_close($c);
    preg_match('/<text>(.*)<\/text>/', $src, $m);
    $status = htmlentities($m[1]);
    if( $hyperlinks ) $status = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $status);
    return($status);
}
?>

<?php
function twitter_time($twitter_id, $hyperlinks = true) {
    $c = curl_init();
    curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1");
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    $src = curl_exec($c);
    curl_close($c);
    preg_match('/<created_at>(.*)<\/created_at>/', $src, $m);
    $status = htmlentities($m[1]);
    if( $hyperlinks ) $status = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $status);
    return($status);
}
?>

<div id="status">
<center>
<?php
echo twitter_status(twitter_id) ." on " .twitter_time(twitter_id);
?>
</center>
</div>
</body>
</html>


You'll need your twitter id, if you want more you can pull it from the xml

Example

by the way you'll need curl on the server enabled

yes, but any nice UI provide? thanks
matchung Wrote:yes, but any nice UI provide? thanks

UI will have to be done in css, and i fail at that :(
Mickey Wrote:
matchung Wrote:yes, but any nice UI provide? thanks

UI will have to be done in css, and i fail at that :(

Sadist im noob too
Pages: 1 2 3 4
Reference URL's