Advertisement
Guest User

twitter

a guest
Oct 9th, 2012
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1.  
  2. <?php
  3. include_once(ABSPATH . WPINC . '/feed.php');
  4. $rss = fetch_feed('https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=urbanpalatela');
  5. $maxitems = $rss->get_item_quantity(3);
  6. $rss_items = $rss->get_items(0, $maxitems);
  7. ?>
  8.  
  9. <ul>
  10. <?php if ($maxitems == 0) echo '<li>No items.</li>';
  11. else
  12. // Loop through each feed item and display each item as a hyperlink.
  13. foreach ( $rss_items as $item ) : ?>
  14. <li>
  15. <a href='<?php echo $item->get_permalink(); ?>'>
  16. <?php echo str_replace('UrbanPalateLA: ', '&bull;', $item->get_title()); ?>
  17. </a>
  18. </li>
  19. <?php endforeach; ?>
  20. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement