Twitter op je site

Gestart doorSanderosz11 reacties52 weergaven

12 berichten · pagina 1 van 1

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Vraag het aan Klaasie, die beheert die site yummie
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Alsjeblieft.

[COLOR= #0000BB]<?php

        

        $username[/COLOR]        [COLOR= #007700]=[/COLOR]    [COLOR= #DD0000]twitter[/COLOR][COLOR= #007700];[/COLOR]

        [COLOR= #0000BB]$tweetCount[/COLOR]        [COLOR= #007700]=[/COLOR]    [COLOR= #0000BB]14[/COLOR][COLOR= #007700];[/COLOR] 

        [COLOR= #0000BB]$twitterFeed[/COLOR]     [COLOR= #007700]=[/COLOR]     [COLOR= #DD0000]http://api.twitter.com/1/statuses/user_timeline/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000].xml?count=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$tweetCount[/COLOR][COLOR= #007700];

        

        function[/COLOR] timeAgo[COLOR= #007700]([/COLOR][COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700])

            {[/COLOR]

                [COLOR= #0000BB]$timestamp[/COLOR]    [COLOR= #007700]=[/COLOR]    [URL="http://www.php.net/strtotime"]strtotime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$now[/COLOR]        [COLOR= #007700]=[/COLOR]    [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]();[/COLOR]

                [COLOR= #0000BB]$timediff[/COLOR]    [COLOR= #007700]=[/COLOR]    [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$now[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]);[/COLOR]

                

                [URL="http://www.php.net/switch"]switch[/URL][COLOR= #007700]([/COLOR]true[COLOR= #007700])

                    {

                        case ([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$timediff[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] seconden geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]60[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]3600[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]60[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] minuten geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]3600[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]7200[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]3600[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] uur geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]7200[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]86400[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]3600[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] uren geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]86400[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]172800[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]86400[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] dag geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]172800[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]602800[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]86400[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] dagen geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]602800[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]1209600[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]602800[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] week geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]1209600[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]3026000[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]602800[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] weken geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        default:[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]d-m-Y H:i[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]);

                    }

            }

     

            

        

        function[/COLOR] makeLinksClickable[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700])

            {[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#(^|[n ])([w]+?://[w]+[^ "nrt< ]*)#"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"1<a href="2" target="_blank">2</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#(^|[n ])((www|ftp).[^ "tnr< ]*)#"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"1<a href="http://2" target="_blank">2</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"/@(w+)/"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"<a href="http://www.twitter.com/1" target="_blank">@1</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"/#(w+)/"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"<a href="http://search.twitter.com/search?q=1" target="_blank">#1</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700];

            }[/COLOR]

        

        [COLOR= #0000BB]$twitterCurl[/COLOR] [COLOR= #007700]=[/COLOR]     curl_init[COLOR= #007700]();[/COLOR]

                        curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$twitterFeed[/COLOR][COLOR= #007700]);[/COLOR]

                        curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] TRUE[COLOR= #007700]);[/COLOR]

        [COLOR= #0000BB]$twitter[/COLOR]     [COLOR= #007700]=[/COLOR]    curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700]);[/COLOR]

        [COLOR= #0000BB]$tweets[/COLOR]     [COLOR= #007700]=    new[/COLOR] SimpleXMLElement[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitter[/COLOR][COLOR= #007700]);[/COLOR]

        

        [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$tweets[/COLOR][COLOR= #007700]->[/COLOR]status [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$tweet[/COLOR][COLOR= #007700]) 

            {[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]<div class="tweet-message">[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]            makeLinksClickable[COLOR= #007700]([/COLOR][COLOR= #0000BB]$tweet[/COLOR][COLOR= #007700]->[/COLOR]text[COLOR= #007700]);[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]<div class="tweet-post-datetime"><i>[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]            timeAgo[COLOR= #007700]([/COLOR][COLOR= #0000BB]$tweet[/COLOR][COLOR= #007700]->[/COLOR]created_at[COLOR= #007700]);[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]            [COLOR= #DD0000]</i><br />[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];

                

            }[/COLOR]
        

        curl_close[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700]);[/COLOR]

    ?>
0
Sanderosz

Lid · Topicstarter

Berichten
766
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gamedealer schreef:
Alsjeblieft.
Spoiler tonen
[COLOR= #0000BB]<?php

        

        $username[/COLOR]        [COLOR= #007700]=[/COLOR]    [COLOR= #DD0000]twitter[/COLOR][COLOR= #007700];[/COLOR]

        [COLOR= #0000BB]$tweetCount[/COLOR]        [COLOR= #007700]=[/COLOR]    [COLOR= #0000BB]14[/COLOR][COLOR= #007700];[/COLOR] 

        [COLOR= #0000BB]$twitterFeed[/COLOR]     [COLOR= #007700]=[/COLOR]     [COLOR= #DD0000]http://api.twitter.com/1/statuses/user_timeline/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000].xml?count=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$tweetCount[/COLOR][COLOR= #007700];

        

        function[/COLOR] timeAgo[COLOR= #007700]([/COLOR][COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700])

            {[/COLOR]

                [COLOR= #0000BB]$timestamp[/COLOR]    [COLOR= #007700]=[/COLOR]    [URL="http://www.php.net/strtotime"]strtotime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$now[/COLOR]        [COLOR= #007700]=[/COLOR]    [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]();[/COLOR]

                [COLOR= #0000BB]$timediff[/COLOR]    [COLOR= #007700]=[/COLOR]    [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$now[/COLOR] [COLOR= #007700]-[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]);[/COLOR]

                

                [URL="http://www.php.net/switch"]switch[/URL][COLOR= #007700]([/COLOR]true[COLOR= #007700])

                    {

                        case ([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$timediff[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] seconden geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]60[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]3600[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]60[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] minuten geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]3600[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]7200[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]3600[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] uur geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]7200[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]86400[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]3600[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] uren geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]86400[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]172800[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]86400[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] dag geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]172800[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]602800[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]86400[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] dagen geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]602800[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]1209600[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]602800[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] week geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        case([/COLOR][COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]>=[/COLOR] [COLOR= #0000BB]1209600[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$timediff[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]3026000[/COLOR][COLOR= #007700]):[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/floor"]floor[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$timediff[/COLOR]/[COLOR= #0000BB]602800[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] weken geleden geplaatst[/COLOR][COLOR= #007700];

                        

                        default:[/COLOR]

                        [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]d-m-Y H:i[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$timestamp[/COLOR][COLOR= #007700]);

                    }

            }

     

            

        

        function[/COLOR] makeLinksClickable[COLOR= #007700]([/COLOR][COLOR= #0000BB]$text[/COLOR][COLOR= #007700])

            {[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#(^|[n ])([w]+?://[w]+[^ "nrt< ]*)#"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"1<a href="2" target="_blank">2</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#(^|[n ])((www|ftp).[^ "tnr< ]*)#"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"1<a href="http://2" target="_blank">2</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"/@(w+)/"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"<a href="http://www.twitter.com/1" target="_blank">@1</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [COLOR= #0000BB]$text[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/preg_replace"]preg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"/#(w+)/"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"<a href="http://search.twitter.com/search?q=1" target="_blank">#1</a>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700]);[/COLOR]

                [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$text[/COLOR][COLOR= #007700];

            }[/COLOR]

        

        [COLOR= #0000BB]$twitterCurl[/COLOR] [COLOR= #007700]=[/COLOR]     curl_init[COLOR= #007700]();[/COLOR]

                        curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$twitterFeed[/COLOR][COLOR= #007700]);[/COLOR]

                        curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] TRUE[COLOR= #007700]);[/COLOR]

        [COLOR= #0000BB]$twitter[/COLOR]     [COLOR= #007700]=[/COLOR]    curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700]);[/COLOR]

        [COLOR= #0000BB]$tweets[/COLOR]     [COLOR= #007700]=    new[/COLOR] SimpleXMLElement[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitter[/COLOR][COLOR= #007700]);[/COLOR]

        

        [URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$tweets[/COLOR][COLOR= #007700]->[/COLOR]status [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$tweet[/COLOR][COLOR= #007700]) 

            {[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]<div class="tweet-message">[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]            makeLinksClickable[COLOR= #007700]([/COLOR][COLOR= #0000BB]$tweet[/COLOR][COLOR= #007700]->[/COLOR]text[COLOR= #007700]);[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]<div class="tweet-post-datetime"><i>[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]            timeAgo[COLOR= #007700]([/COLOR][COLOR= #0000BB]$tweet[/COLOR][COLOR= #007700]->[/COLOR]created_at[COLOR= #007700]);[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]            [COLOR= #DD0000]</i><br />[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/echo"]echo[/URL]        [COLOR= #DD0000]</div>[/COLOR][COLOR= #007700];

                

            }[/COLOR]
        

        curl_close[COLOR= #007700]([/COLOR][COLOR= #0000BB]$twitterCurl[/COLOR][COLOR= #007700]);[/COLOR]

    ?>


waar gevonden?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Niet gezocht.
Vond je zo op phphulp.nl
0
Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Even een opmerking. Waarom gebruikt iedereen altijd cURL bij deze scripts? Twitter geeft als request niets voor niets een .xml bestand terug? Gebruik simpleXML (PHP), das een stuk netter.
0
Berichten
5.498
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gamedealer schreef:
Euhm.
http://www.one2xs.com/threads/39289
Daar, en op nog heel veel andere sites.

Eigenlijk komt die gewoon van MuziekTop af hypocriteDat is dus ook het script wat ik op mijn site gebruik.
0
Berichten
10.857
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien

Den Haag

Klaasie schreef:
Eerdere citaten tonen
Gamedealer schreef:
Euhm.
http://www.one2xs.com/threads/39289
Daar, en op nog heel veel andere sites.

Eigenlijk komt die gewoon van MuziekTop af hypocriteDat is dus ook het script wat ik op mijn site gebruik.
Ik had hem gewoon re-released op one2xs en jij gebruikte hem daarna emo
http://www.one2xs.com/threads/36563
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Caner schreef:
Eerdere citaten tonen
Klaasie schreef:
Eerdere citaten tonen
Gamedealer schreef:
Euhm.
http://www.one2xs.com/threads/39289
Daar, en op nog heel veel andere sites.

Eigenlijk komt die gewoon van MuziekTop af hypocriteDat is dus ook het script wat ik op mijn site gebruik.
Ik had hem gewoon re-released op one2xs en jij gebruikte hem daarna emo
http://www.one2xs.com/threads/36563
En jij had hem weer van ergens anders ( phphulp oid )
0
Berichten
5.498
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Caner schreef:
Eerdere citaten tonen
Klaasie schreef:
Eerdere citaten tonen
Gamedealer schreef:
Euhm.
http://www.one2xs.com/threads/39289
Daar, en op nog heel veel andere sites.

Eigenlijk komt die gewoon van MuziekTop af hypocriteDat is dus ook het script wat ik op mijn site gebruik.
Ik had hem gewoon re-released op one2xs en jij gebruikte hem daarna emo
http://www.one2xs.com/threads/36563
Klopt smile
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren