Welcome to Geeklog, Anonymous Tuesday, May 14 2024 @ 01:47 pm EDT

Geeklog Forums

BlockBuster via RSS in a StaticPage


Status: offline

mst3kroqs

Forum User
Regular Poster
Registered: 10/18/05
Posts: 78
Location:Cary, NC USA
In this post, I illustrated how to utilize RSS as a means to access NetFlix's DVD-by-mail rental service. Some asked me to create a BlockBuster version (lest I be accused of showing favoritism towards NetFlix), so the code is below (it'sfundamentally the same script). Refer to the prior post for installation instructions, and you may want to maximize the width of your browser to improve the readability of the below:
Text Formatted Code

global $_CONF;

$spurl = $_CONF['site_url'] . "/staticpages/index.php"; // you shouldn't have to change this

// you need the magpie rss class to make this work.  you can retrieve the latest version (0.72)
// as of this writing from: http://magpierss.sourceforge.net.  it doesn't matter where you put the
// package, the path below reflects my choice - which was to unzip it to my geeklog system directory

require_once $_CONF['path'] . "system/magpierss-0.72/rss_fetch.inc";

// user/site-specific config

$spid = "bbuster";                                      // must match staticpage id (not title)
$bbqid = "0123456789ABCDEF0123456789ABCDEF";            // your blockbuster queue ID (see note below)
$bbaid = "0123456789ABCDEF0123456789ABCDEF";            // your blockbuster recent activity ID
$bbrid = "0123456789ABCDEF0123456789ABCDEF";            // your blockbuster recommendations ID
$qmax = 20;                                             // max queue entries to display
$nmax = 40;                                             // max new releases to display

// note:  to find your blockbuster queue, activity and recommendation ID's, login to blockbuster,
// and click 'RSS' on the top menu bar.  Under 'Personal Feeds', you will see your id's appended to the My Queue,
// My Recent Rentals and My Recommendations links 32 digit hex numbers.  Your blockbuster queue, recent activity
// and recommendations id's are unique to you, the id's above are set to dummy values.  note that these id's are
// three different values

// don't forget to put the logo image in your /images directory.  feel free to retrieve the .png from
// my site if you like:  http://www.the-howards.net/images/bbuster-logo.png.  the blockbuster logo is copyright
// and trademarked by blockbuster, i'm sure.

$retval = "<p><a href=\"http://www.blockbuster.com\"><img width=\"124\" height=\"76\" align=\"right\" src=\"/images/bbuster-logo.png\" alt=\"www.blockbuster.com\" /></a>";

$rpt = $_GET['rpt'];

switch ($rpt) {

// Recent Activity

case "recent":
    $retval .= "<b>Recent Activity</b></p>";
    $rss = fetch_rss("http://www.blockbuster.com/rss/rentalHistory/{$bbaid}");
    if (count($rss->items) > 0) {
        $retval .= "<ul>";
        foreach ($rss->items as $item) {
            $title = stripslashes($item['title']);
            $retval .= "<li><a href=\"{$item['link'] }\">{$title}</a><br>\n";
        }
        $retval .= "</ul>";
    } else {
        $retval .= "<br>(None)<br><br>";
    }
    $retval .= "View: [ " ."In Queue" ." | New Releases" ." | Recommendations" ." | Top25 Classics" ." ]<br><br>\n";
    break;

// New Releases

case "new":
    $retval .= "<b>New Releases</b></p>";
    $rss = fetch_rss("http://www.blockbuster.com/rss/newRelease");
    $n = count($rss->items);
    if ($n > 0) {
        $retval .= "<ul>";
        if ($n > $nmax) $n = $nmax;
        for ($i = 0; $i < $n; $i++) {
            $title = stripslashes($rss->items[$i]['title']);
            $link = $rss->items[$i]['link'];
            $retval .= "<li><a href=\"{$link}\">{$title}</a><br>\n";
        }
        $retval .="</ul>";
    }
    $retval .= "View: [ " ."In Queue" ." | Recent Activity" ." | Recommendations" ." | Top25 Classics" ." ]<br><br>\n";
    break;

// Recommendations

case "recommend":
    $retval .= "<b>Recommendations</b></p>";
    $rss = fetch_rss("http://www.blockbuster.com/rss/recommendations/{$bbrid}");
    if (count($rss->items) > 0) {
        $retval .= "<ul>";
        foreach ($rss->items as $item) {
            $title = stripslashes($item['title']);
            $retval .= "<li><a href=\"{$item['link'] }\">{$title}</a><br>\n";
        }
        $retval .= "</ul>";
    }
    $retval .= "View: [ " ."In Queue" ." | Recent Activity" ." | New Releases" ." | Top25 Classics" ." ]<br><br>\n";
    break;

// Top25 Classics

case "classics":
    $retval .= "<b>Top 25 Classics</b></p>";
    $rss = fetch_rss("http://www.blockbuster.com/rss/top25/classics");
    if (count($rss->items) > 0) {
        $retval .= "<ul>";
        foreach ($rss->items as $item) {
            $title = stripslashes($item['title']);
            $retval .= "<li><a href=\"{$item['link'] }\">{$title}</a><br>\n";
        }
        $retval .= "</ul>";
    }
    $retval .= "View: [ " ."In Queue" ." | Recent Activity" ." | New Releases" ." | Recommendations" ." ]<br><br>\n";
    break;

// Default BlockBuster Report Screen

default:
    $retval .= "<b>Movies in the Queue</b> [ Visit Queue ]</p>";

    $rss = fetch_rss("http://www.blockbuster.com/rss/queue/{$bbqid}");
    $n = count($rss->items);
    if ($n > 0) {
        $retval .= "<ul>";
        if ($n > $qmax) $n = $qmax;
        for ($i = 0; $i < $n; $i++) {
            $title = stripslashes($rss->items[$i]['title']);
            $link = $rss->items[$i]['link'];
            $retval .= "<li><a href=\"{$link}\">{$title}</a><br>\n";
        }
        $retval .="</ul>";
    } else {
        $retval .= "(None)<br><br>";
    }
    $retval .= "View: [ " ."Recent Activity" ." | New Releases" ." | Recommendations" ." | Top25 Classics" ." ]<br><br>\n";

}
 
Have fun!
 Quote

All times are EDT. The time is now 01:47 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content