PHP Twitter Feed
$30-100 USD
Publicado há mais de 13 anos
$30-100 USD
Pago na entrega
We have the following PHP Twitter feed which works fine with all our feeds except the one shown below.
This job entail making the code work with the Twitter account
holiday2europe
## Deliverables
PHP code shown here
<?php
$username = "holiday2europe";
$num = 5;
$feed = "[login to view URL]:" . $username . "&rpp=" . $num;
$newfile = dirname(__FILE__)."/[login to view URL]";
$file = dirname(__FILE__)."/[login to view URL]";
copy($feed, $newfile);
$oldcontent = @file_get_contents($file);
$newcontent = @file_get_contents($newfile);
if($oldcontent != $newcontent) {
copy($newfile, $file);
}
$tweets = @file_get_contents($file);
$tweets = json_decode($tweets);
echo "<ul>";
for($x=0;$x<$num;$x++) {
$str = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $tweets->results[$x]->text);
$pattern = '/[#|@][^\s]*/';
preg_match_all($pattern, $str, $matches);
foreach($matches[0] as $keyword) {
$keyword = str_replace(")","",$keyword);
$link = str_replace("#","%23",$keyword);
$link = str_replace("@","",$keyword);
if(strstr($keyword,"@")) {
$search = "<a href=\"[login to view URL]$link\">$keyword</a>";
} else {
$link = urlencode($link);
$search = "<a href=\"[login to view URL]$link\" class=\"grey\">$keyword</a>";
}
$str = str_replace($keyword, $search, $str);
}
echo "<li>".$str."</li>\n";
}
echo "</ul>";
?>
ID do Projeto: 3807346
Sobre o projeto
2 propostas
Projeto remoto
Ativo há 14 anos
Quer ganhar algum dinheiro?
Benefícios de ofertar no Freelancer
Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
É grátis para se inscrever e fazer ofertas em trabalhos
2 freelancers estão ofertando em média $17 USD for esse trabalho
$38,25 USD em 1 dia
4,7 (97 avaliações) $25,50 USD em 1 dia
4,9 (15 avaliações) $8,50 USD em 1 dia
5,0 (24 avaliações)