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:


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:
$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 
"
    ";
    foreach(
    $xml->channel->item as $item) {
    foreach(
    $elements as $element) {
    $
    $element $disableUtf8 utf8_decode($item->$element) : $item->$element;
    }
    $date formatTimestamp(strtotime($pubDate), 's');
    echo 
    "
  • .$link."' target='_blank'>".$date.' - '.strip_tags($title)."
  • "
    ;
    }
    echo 
    "
"
;
echo 
".$yourTwitterUrl."'>Follow us on Twitter";
}


...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.

$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 
"
    "
    $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 
    "
  • .$link."' target='_blank'>".$date.' - '.strip_tags($title)."
  • "
    ;
        if (
    $i $limit) {
            
    $i++;
        } else {
            break;
        }

    echo 
    "
"

echo 
".$yourTwitterUrl."'>Follow us on Twitter"
}


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...

Login

Who's Online

267 user(s) are online (78 user(s) are browsing Support Forums)


Members: 0


Guests: 267


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits