11
bjuti
Re: Does everyone have to make a buck on twitter blocks
  • 2012/4/27 21:12

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Sorry, I ment 5 items of RSS feed :)

12
Anonymous
Re: Does everyone have to make a buck on twitter blocks
  • 2012/4/27 21:56

  • Anonymous

  • Posts: 0

  • Since: 0


Sorry but I am getting confused bjuti Is the preferences link I talked about what you are looking for?

13
bjuti
Re: Does everyone have to make a buck on twitter blocks
  • 2012/4/28 8:27

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Haha :) What's there not understanable? :)

This code:
le="color: #000000"><?php $feedUrl = 'http://twitter.com/statuses/user_timeline/15268838.rss'; $yourTwitterUrl = 'http://www.twitter.com/ibleedv20'; $disableUtf8 = false; // ******************************************************** require XOOPS_ROOT_PATH.'/class/snoopy.php'; $snoopyDog = new Snoopy(); $snoopyDog->fetch($feedUrl); $xml = simplexml_load_string($snoopyDog->results); if($xml !== false) { $elements = array('title', 'description', 'pubDate', 'guid', 'link'); echo "<ul>"; foreach($xml->channel->item as $item) { foreach($elements as $element) { $$element = $disableUtf8 ? utf8_decode($item->$element) : $item->$element; } $date = formatTimestamp(strtotime($pubDate), 's'); echo "<li><a href='".$link."' target='_blank'>".$date.' - '.strip_tags($title)."</a></li>"; } echo "</ul>"; echo "<br /><a href='".$yourTwitterUrl."'>Follow us on Twitter</a>"; }


...shows all the feeds from rss feed eg. 15.

I need to show only 5 or 6 or 1 :)

14
zyspec
Re: Does everyone have to make a buck on twitter blocks
  • 2012/4/28 23:17

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


bjuti,

This should do what you want... It's kinda ugly but it should work.

le="color: #000000"><?php $feedUrl = 'http://twitter.com/statuses/user_timeline/15268838.rss'; $yourTwitterUrl = 'http://www.twitter.com/ibleedv20'; $disableUtf8 = false; $limit = 5; // change this value to limit the number of feed items // ******************************************************** require XOOPS_ROOT_PATH.'/class/snoopy.php'; $snoopyDog = new Snoopy(); $snoopyDog->fetch($feedUrl); $xml = simplexml_load_string($snoopyDog->results); if($xml !== false) { $elements = array('title', 'description', 'pubDate', 'guid', 'link'); echo "<ul>"; $i = 0; foreach($xml->channel->item as $item) { foreach($elements as $element) { $$element = $disableUtf8 ? utf8_decode($item->$element) : $item->$element; } $date = formatTimestamp(strtotime($pubDate), 's'); echo "<li><a href='".$link."' target='_blank'>".$date.' - '.strip_tags($title)."</a></li>"; if ($i < $limit) { $i++; } else { break; } } echo "</ul>"; echo "<br /><a href='".$yourTwitterUrl."'>Follow us on Twitter</a>"; }


15
bjuti
Re: Does everyone have to make a buck on twitter blocks
  • 2012/5/2 19:18

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


Tnx zyspec it works like charm :)

16
zyspec
Re: Does everyone have to make a buck on twitter blocks
  • 2012/5/4 4:56

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Glad it worked for you...