Thread: TV Guide
View Single Post
  #1  
Old 11th November 2012, 00:09
firefly's Avatar
firefly firefly is offline
Senior Member
 
Join Date: Dec 2009
P2P
Posts: 74
Default TV Guide
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 '<br>'

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;
}
Click the image to open in full size.
Attached Files
File Type: rar tvguide.rar (17.7 KB, 71 views)
Reply With Quote
The Following 6 Users Say Thank You to firefly For This Useful Post:
FENIX (10th May 2013), L3X (11th November 2012), Marco (12th November 2012), mmisu120000 (12th November 2012), PAX (20th November 2012), Titya (1st February 2013)