Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=117)
-   -   TV Guide (http://www.bvlist.com/showthread.php?t=8473)

firefly 11th November 2012 00:09

TV Guide
 
1 Attachment(s)
Hi there,

Ive made a TV Guide scraper, that scrapes from SCC.

This is how it works

1) logs in to SCC using CuRL and cookiejar.

PHP Code:

$ch curl_init();

curl_setopt($chCURLOPT_URL$site);
curl_setopt($chCURLOPT_POSTFIELDS,'&username='.urlencode($username).'&password='.urlencode($password).'&submit=come on in');
curl_setopt($curlCURLOPT_POSTFIELDS$postVars);
curl_setopt($chCURLOPT_POST1);
curl_setopt($chCURLOPT_HEADER0);
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
curl_setopt($chCURLOPT_COOKIEJAR$cookie);
curl_setopt($chCURLOPT_COOKIEFILE$cookie);
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
curl_exec($ch); 

2) Then the second part of the CuRL script redirects to the tvguide page and writes the content of the tv guide page to a file called store.php

PHP Code:

$fp fopen("include/store.php""w");

curl_setopt($chCURLOPT_URL$site2);
curl_setopt($chCURLOPT_HTTPGET1);
curl_setopt($chCURLOPT_FILE$fp);
curl_exec($ch); 

3) Now we need to get only the relative content from the file that was generated using DOM and then echo the reative information.



PHP Code:

$html file_get_html("include/store.php");
    foreach(
$html->find($tag) as $e)
    
$main $e->innertext ''


3) Now we want to style the results according to your needs..



Install

1) Unpack rar

2) Copy guide.php to your root folder.

3) Copy guide.lang.php to include/langlanguages/english/ or the lang you use.

4) Copy simple_html_dom.php and conf.php to /include/


Config

Edit conf.php you added to your include folder.


and copy this to your template stylesheet

HTML Code:

#std_box_tv_content {
    font-size: 10px;
}
.wrap {
border: thin solid #0F5C8E;
}
 #std_box_wrapper #std_box_tv_content .tv_schedule_list .flag_float .small_middle {
    background-color: #92CEEB;
}
#tv_schedule_list {
}
.tv_schedule_list_highlight {
    background-color: #27CDD6;
    display: block;
    height: 15px;
    font-weight: bolder;
    color: #FFFFFF;
    text-indent: 5px;
}
#std_box_tv_header {
    font-size: 14px;
    color: #0033FF;
    text-indent: 5px;
}
#std_box_wrapper #std_box_tv_content .tv_schedule_list li {
    background-color: #6CE1FF;
    font-weight: bolder;
    color: #0033CC;
    text-indent: 5px;
}
#std_box_wrapper #std_box_tv_content .tv_schedule_list li a {
    font-weight: bolder;
    color: #00CCFF;
    text-indent: 5px;
    text-shadow: 1px 1px 1px #000; /* FF3.5+, Opera 9+, Saf1+, Chrome, IE10 */
    font-size: 12px;
}
.theadmain {
    color: #0033FF;
    background-color: #00CCFF;
    height: 25px;
}
.ping {
    font-size: 10px;
    font-weight: bolder;
}
#std_box_wrapper #std_box_tv_content .tv_schedule_list .tv_schedule_list_highlight {
    font-weight: bold;
    color: #FFFFFF;
    background-color: #0066FF;
    font-size: 14px;
    text-indent: 5px;
}

http://diginova.co.za/tvscreen.jpg

L3X 11th November 2012 01:14

Thank you, excellent work!! :drink:


All times are GMT +2. The time now is 09:17.

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