Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Yuna Scatari Edition (YSE) (http://www.bvlist.com/forumdisplay.php?f=22)
-   -   TV series/games/movies (http://www.bvlist.com/showthread.php?t=8557)

mat22 1st December 2012 20:01

TV series/games/movies
 
Hello!
I already have something like this but I have to enter everything manually by hand and it's real pain in the ass. So I need script that takes information about movies, games and TV series that are coming out in future and shows them like a list with maybe iamges on my tracker. I don't need anything fancy - I just need base script that takes those things, adds custom image (for example, if it's Walking Dead series it adds Walking Dead logo) and shows on my tracker. I will modify the script later by myself.

wMan 2nd December 2012 02:57

try this edit to your needs
@root call it shows.php

PHP Code:

<?
    ob_start
("ob_gzhandler");

require 
"include/bittorrent.php";
dbconn(false);
loggedinorreturn();
hit_count();
stdhead(Episodes);


//define shows here
$showcount 4;


$showname[1] = "Lost";
$showimg[1] ="pic/episodes/lost.jpg";

$showname[2] = "Prison Break";
$showimg[2] ="pic/episodes/prbreak.jpg";

$showname[3] = "Heroes";
$showimg[3] ="pic/episodes/heroes.jpg";

$showname[4] = "24";
$showimg[4] ="pic/episodes/24.jpg";
//end


function get_show($show,$exact="",$episode="") {

if ( !
$show ) { return FALSE; }

if ( 
$fp fopen("http://www.tvrage.com/quickinfo.php?show=".urlencode($show)."&ep=".urlencode($episode)."&exact=".urlencode($exact),"r") )
  {
  while ( !
feof($fp))
    {
    
$line fgets($fp,1024);
    list (
$sec,$val) = explode('@',$line,2);
    if (
$sec == "Show Name" )
      {
      
$ret[0] = $val;
      }
    elseif ( 
$sec == "Show URL" )
      {
      
$ret[1] = $val;
      }
    elseif ( 
$sec == "Premiered" )
      {
      
$ret[2] = $val;
      }
    elseif (
$sec == "Country" )
      {
      
$ret[7] = $val;
      }
    elseif ( 
$sec == "Status" )
      {
      
$ret[8] = $val;
      }
    elseif ( 
$sec == "Classification" )
      {
      
$ret[9] = $val;
      }

    elseif ( 
$sec == "Latest Episode" )
      {
      list (
$ep,$title,$airdate) = explode('^',$val);
      
$ret[3] = $ep.", \"".$title."\" aired on ".$airdate;
      }
    elseif ( 
$sec == "Next Episode" )
      {
      list (
$ep,$title,$airdate) = explode('^',$val);
      
$ret[4] = $ep.", \"".$title."\" airs on ".$airdate;
      }
    elseif ( 
$sec == "Episode Info" )
      {
      list (
$ep,$title,$airdate) = explode('^',$val);
      
$ret[5] = $ep.", \"".$title."\" aired on ".$airdate;
      }
    elseif ( 
$sec == "Episode URL" )
      {
      
$ret[6] = $val;
      }
    }
  
fclose($fp);
  if ( 
$ret[0] )
    {
    return 
$ret;
    }
  }
else
  {
  return 
FALSE;
  }
}

//search
?>

<table width=800 cellpadding=1>
<tr>
<td class=colhead align=center>Search</td>
<tr><td align=center>
<form action='http://www.tvrage.com/search.php' method='GET'>
Search For: <select name='sonly'><option value='0'>Shows & People</option><option value='1'>Shows</option><option value='2'>People</option></select>
<input type='text' name='search'>
<input type='submit' value='Search!'>
</form>
</td></tr>
</tr>
</table>

<?
//end of search

for($i 1$i $showcount+1$i++) { 
$show_infos1 get_show("$showname[$i]","1");

//view shows
print("<table border=1 width=500 cellspacing=0 cellpadding=1>\n");
print(
"<tr><td class=colhead align=center>".$show_infos1[0]."</td>\n");
print(
"<tr><td class=colhead align=center><img src=$showimg[$i]></td></tr>\n");
print(
"<tr><td align=center><table border=0 width=745 cellspacing=0 cellpadding=2>\n");
print(
"<tr><td class=colhead align=center>Last Episode</td>\n");
print(
"<td>".$show_infos1[3]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Next Episode</td>\n");
print(
"<td>".$show_infos1[4]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Country</td>\n");
print(
"<td>".$show_infos1[7]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Status</td>\n");
print(
"<td>".$show_infos1[8]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Show Link</td>\n");
print(
"<td><a  class=altlink target=_blank href=".$show_infos1[1].">Link</a></td></tr>\n");
print(
"</tr></table>\n");
print(
"</tr></table>\n");
}

//end


//start rss read
define('MAGPIE_DIR''magpierss/');
define('MAGPIE_CACHE_DIR''cache/magpie_cache');
require_once(
MAGPIE_DIR'rss_fetch.inc');


print(
"<table border=1 width=800 cellspacing=0 cellpadding=3>\n");
print(
"<tr>\n\t<td class=colhead align=center width=60>Time</td>\n\t<td class=colhead align=center width=220>Name</td>\n\t<td class=colhead align=center width=220>Description</td>\n</tr>\n");

$url 'http://www.tvrage.com/myrss.php';
if ( 
$url ) {
    
$rss fetch_rss$url );
    foreach (
$rss->items as $item) {
        if (
$item['description']==''$chas $item['title'];
        
$href $item['link'];
        
$title $item['title'];
        
$title str_replace(" - ","",$title);
              
$description $item['description']; 
              if (
$item['description']<>'') print("<tr>\n\t<td align=center>$chas</td>\n\t<td align=center><a target =_blank href=$href>$title</a></td>\n\t");
              if (
$item['description']<>'') print("<td align=center>$description</a></td>\n</tr>\n");
    }
}

print(
"</table>\n");
//end

stdfoot();
hit_end();
?>


firefly 2nd December 2012 03:11

Quote:

Originally Posted by bill123 (Post 37817)
try this edit to your needs
@root call it shows.php

PHP Code:

<?
    ob_start
("ob_gzhandler");

require 
"include/bittorrent.php";
dbconn(false);
loggedinorreturn();
hit_count();
stdhead(Episodes);


//define shows here
$showcount 4;


$showname[1] = "Lost";
$showimg[1] ="pic/episodes/lost.jpg";

$showname[2] = "Prison Break";
$showimg[2] ="pic/episodes/prbreak.jpg";

$showname[3] = "Heroes";
$showimg[3] ="pic/episodes/heroes.jpg";

$showname[4] = "24";
$showimg[4] ="pic/episodes/24.jpg";
//end


function get_show($show,$exact="",$episode="") {

if ( !
$show ) { return FALSE; }

if ( 
$fp fopen("http://www.tvrage.com/quickinfo.php?show=".urlencode($show)."&ep=".urlencode($episode)."&exact=".urlencode($exact),"r") )
  {
  while ( !
feof($fp))
    {
    
$line fgets($fp,1024);
    list (
$sec,$val) = explode('@',$line,2);
    if (
$sec == "Show Name" )
      {
      
$ret[0] = $val;
      }
    elseif ( 
$sec == "Show URL" )
      {
      
$ret[1] = $val;
      }
    elseif ( 
$sec == "Premiered" )
      {
      
$ret[2] = $val;
      }
    elseif (
$sec == "Country" )
      {
      
$ret[7] = $val;
      }
    elseif ( 
$sec == "Status" )
      {
      
$ret[8] = $val;
      }
    elseif ( 
$sec == "Classification" )
      {
      
$ret[9] = $val;
      }

    elseif ( 
$sec == "Latest Episode" )
      {
      list (
$ep,$title,$airdate) = explode('^',$val);
      
$ret[3] = $ep.", \"".$title."\" aired on ".$airdate;
      }
    elseif ( 
$sec == "Next Episode" )
      {
      list (
$ep,$title,$airdate) = explode('^',$val);
      
$ret[4] = $ep.", \"".$title."\" airs on ".$airdate;
      }
    elseif ( 
$sec == "Episode Info" )
      {
      list (
$ep,$title,$airdate) = explode('^',$val);
      
$ret[5] = $ep.", \"".$title."\" aired on ".$airdate;
      }
    elseif ( 
$sec == "Episode URL" )
      {
      
$ret[6] = $val;
      }
    }
  
fclose($fp);
  if ( 
$ret[0] )
    {
    return 
$ret;
    }
  }
else
  {
  return 
FALSE;
  }
}

//search
?>

<table width=800 cellpadding=1>
<tr>
<td class=colhead align=center>Search</td>
<tr><td align=center>
<form action='http://www.tvrage.com/search.php' method='GET'>
Search For: <select name='sonly'><option value='0'>Shows & People</option><option value='1'>Shows</option><option value='2'>People</option></select>
<input type='text' name='search'>
<input type='submit' value='Search!'>
</form>
</td></tr>
</tr>
</table>

<?
//end of search

for($i 1$i $showcount+1$i++) { 
$show_infos1 get_show("$showname[$i]","1");

//view shows
print("<table border=1 width=500 cellspacing=0 cellpadding=1>\n");
print(
"<tr><td class=colhead align=center>".$show_infos1[0]."</td>\n");
print(
"<tr><td class=colhead align=center><img src=$showimg[$i]></td></tr>\n");
print(
"<tr><td align=center><table border=0 width=745 cellspacing=0 cellpadding=2>\n");
print(
"<tr><td class=colhead align=center>Last Episode</td>\n");
print(
"<td>".$show_infos1[3]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Next Episode</td>\n");
print(
"<td>".$show_infos1[4]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Country</td>\n");
print(
"<td>".$show_infos1[7]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Status</td>\n");
print(
"<td>".$show_infos1[8]."</td></tr>\n");
print(
"<tr><td class=colhead align=center>Show Link</td>\n");
print(
"<td><a  class=altlink target=_blank href=".$show_infos1[1].">Link</a></td></tr>\n");
print(
"</tr></table>\n");
print(
"</tr></table>\n");
}

//end


//start rss read
define('MAGPIE_DIR''magpierss/');
define('MAGPIE_CACHE_DIR''cache/magpie_cache');
require_once(
MAGPIE_DIR'rss_fetch.inc');


print(
"<table border=1 width=800 cellspacing=0 cellpadding=3>\n");
print(
"<tr>\n\t<td class=colhead align=center width=60>Time</td>\n\t<td class=colhead align=center width=220>Name</td>\n\t<td class=colhead align=center width=220>Description</td>\n</tr>\n");

$url 'http://www.tvrage.com/myrss.php';
if ( 
$url ) {
    
$rss fetch_rss$url );
    foreach (
$rss->items as $item) {
        if (
$item['description']==''$chas $item['title'];
        
$href $item['link'];
        
$title $item['title'];
        
$title str_replace(" - ","",$title);
              
$description $item['description']; 
              if (
$item['description']<>'') print("<tr>\n\t<td align=center>$chas</td>\n\t<td align=center><a target =_blank href=$href>$title</a></td>\n\t");
              if (
$item['description']<>'') print("<td align=center>$description</a></td>\n</tr>\n");
    }
}

print(
"</table>\n");
//end

stdfoot();
hit_end();
?>


This is all well and good but a better option will be to rather scrape content using CuRL & DOM.

wMan 2nd December 2012 03:39

hahahahaha:drink:

Bump:
Quote:

Originally Posted by firefly (Post 37818)
This is all well and good but a better option will be to rather scrape content using CuRL & DOM.

ive seen yours and its same as the above :lol:

mat22 16th February 2013 14:21

Tried this one but it doesn't return any information for me.


All times are GMT +2. The time now is 10:00.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.