Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Posts
    4
    Plugin Contributions
    0

    help question Twitter Sidebox? (New module creation help)

    Hi,

    I've searched and only come across a module that allows for twitter sending sms to your phone at time of sale. With the use of a php parser, I was able to get the last 3 entries of the RSS feed onto a plain html page. Unfortunately, I don't really understand enough about twitter module creation to be able to implement it.

    I'm assuming there is some sort of Javascript wrapping that is blocking the php.. or something? At any rate, I either can't echo the $html or push it into the $content variable or maybe the script just isn't running at all...

    The code that I'm trying to convert is below. Obviously, for the actual module it was slightly modified to remove tags. Keep in mind that it's for a friend so please ignore the comments


    http://www.fridayafterclass.com/rss/twitter_mod.php

    Code:
    <?php
    require_once '/home7/aonecust/public_html/fridayafterclass/rss/rss_php.php';
    
        $rss = new rss_php;
        $rss->load('http://twitter.com/statuses/user_timeline/18300492.rss');
        $items = $rss->getItems();
    
      $html = '';
    
    
    reset($items);
    while((list($index, $item) = each($items)) && $i<3) {
            $html .= $item['description'].'<br />
                     <a href="'.$item['link'].'">  '.$item['pubDate'].'</a><br />
                        </p>';
            $i++;
        }
    
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Friday After Class: Twitter</title>
    </head>
    
    <body>
    <?php
    echo $html;
    ?>
    </body>
    </html>

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,511
    Plugin Contributions
    126

    Default Re: Twitter Sidebox? (New module creation help)

    If you can wait, I will do this at some point.

    Scott (@thatsoftwareguy)
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,511
    Plugin Contributions
    126

    Default Re: Twitter Sidebox? (New module creation help)

    I started thinking about this today and realized it was a bad idea. If you put it in a sidebox, you'll bear the overhead of talking to Twitter on every page load, which will slow your site down. You'd be better off to add your tweets to an "About Us" page (or create a special page for your tweets using About Us as a template).

    Retrieving your tweets is straightfoward:

    Code:
    <?php
    <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
    <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/YOUR_TWITTER_HANDLE.json?callback=twitterCallback2&count=5"></script>
    ?>
    of course count can be adjusted if you wish to show more.

    Good luck,
    Scott
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Jan 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Twitter Sidebox? (New module creation help)

    Quote Originally Posted by swguy View Post
    I started thinking about this today and realized it was a bad idea. If you put it in a sidebox, you'll bear the overhead of talking to Twitter on every page load, which will slow your site down. You'd be better off to add your tweets to an "About Us" page (or create a special page for your tweets using About Us as a template).

    Retrieving your tweets is straightfoward:

    Code:
    <?php
    <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
    <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/YOUR_TWITTER_HANDLE.json?callback=twitterCallback2&count=5"></script>
    ?>
    of course count can be adjusted if you wish to show more.

    Good luck,
    Scott
    Thanks for your input..

    The tweets are really just a simply rss feed. Couldn't you technically just cache it locally if you're worried about overhead? Could also just quit reading the feed after the first (x) number of items? Maybe the solution is to have some sort of twitter refresh button that calls the process to refresh the feed?

    Quite honestly, I wasn't too worried about efficiency on this one

  5. #5
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Twitter Sidebox? (New module creation help)

    If it's just rss, you can use the rss module by numinix (cant remember the mod name), it has cache as well.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  6. #6
    Join Date
    Jan 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Twitter Sidebox? (New module creation help)

    Quote Originally Posted by yellow1912 View Post
    If it's just rss, you can use the rss module by numinix (cant remember the mod name), it has cache as well.
    thanks, i'll check it out

  7. #7
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Twitter Sidebox? (New module creation help)

    Quote Originally Posted by swguy View Post
    I started thinking about this today and realized it was a bad idea. If you put it in a sidebox, you'll bear the overhead of talking to Twitter on every page load, which will slow your site down.
    Exactly what I thought :-)

    I finally go to creating a Twitter side box add on that solves those issues by caching the Tweets:
    http://www.zen-cart.com/forum/showthread.php?t=181253

 

 

Similar Threads

  1. Twitter sidebox Cached
    By paulm in forum Addon Sideboxes
    Replies: 70
    Last Post: 25 Aug 2015, 09:46 AM
  2. Twitter sidebox
    By karenkte in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 29 Apr 2015, 05:25 PM
  3. v151 Help! - Twitter HTML code in sidebox cause PHP error
    By pexter in forum Addon Sideboxes
    Replies: 1
    Last Post: 3 Jan 2014, 09:12 PM
  4. New Template Creation Help
    By Nick_Sonick in forum Templates, Stylesheets, Page Layout
    Replies: 26
    Last Post: 14 Aug 2007, 01:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg