Jump to content

mark103

Members
  • Posts

    268
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mark103's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. can someone help me please??????????
  2. Sorry I have forgotten to include the code for get-listing.php. Here it is: <html> <body> <script> function ajaxpage(str) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { } } xmlhttp.open("GET",".php?q="+str,true); xmlhttp.send(); } </script> <?php define('DB_HOST', 'localhost'); define('DB_USER', 'myusername'); define('DB_PASSWORD', 'mypassword'); define('DB_DATABASE', 'mydbname_tvguide'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $qrytable1="SELECT id, channels FROM tvguide"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { echo "</br>"; echo "<td>".$row['channels']."</td>"; echo "</br>"; } } mysql_close($link); ?> </body> </html> I want to know how i can resizing the images for per programme in my php when I want to comare the timing for per programme how long the programme will last for, e.g 30 mins, 60 mins...etc do you know how i can compare the timing for per programme using with this tags? <span id='time1'>1:00 PM</span><span id='time2'>2:00 PM</span><span id='time3'>4:00 PM</span><span id='time4'>5:00 PM</span>
  3. Hi guys, I am working on my tv guide website that I output the data to my php from mysql database. I want to know how i can work it out the tv time for per programme how long they would last for, e.g 30 mins, 1 hour...etc <html> <body> <style type="text/css"> #channel1 { position:absolute; font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; visibility:visible; overflow:hidden; left:35px; top:245px; width:176px; height:50px; z-index:1; } #programme1 { position:absolute; font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; visibility:visible; overflow:hidden; left:427px; top:245px; width:176px; height:50px; z-index:1; } #programme2 { position:absolute; font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; visibility:visible; overflow:hidden; left:765px; top:245px; width:176px; height:50px; z-index:1; } #programme3 { position:absolute; font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; visibility:visible; overflow:hidden; left:1110px; top:245px; width:176px; height:50px; z-index:1; } #day { font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; position:absolute; visibility:visible; overflow:hidden; left:294px; top:180px; width:176px; height:50px; z-index:0; } #time1 { font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; position:absolute; visibility:visible; overflow:hidden; left:424px; top:180px; width:176px; height:50px; z-index:0; } #time2 { font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; position:absolute; visibility:visible; overflow:hidden; left:754px; top:180px; width:176px; height:50px; z-index:0; } #time3 { font-family:Arial; font-size:29px; font-style:normal; font-weight:bold; color:f5fdfd; text-decoration:none; text-transform:none; position:absolute; visibility:visible; overflow:hidden; left:1104px; top:180px; width:176px; height:50px; z-index:0; } <?php include("get-listing.php"); ?> <div id="image1" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:245px; width:374px; height:40px; z-index:0"><img src="/images/row1_yellow.jpg" alt="" title="" border=0 width=374 height=50></div> <div id="image2" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:295px; width:374px; height:40px; z-index:0"><img src="/images/row1.jpg" alt="" title="" border=0 width=374 height=50></div> <div id="image3" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:345px; width:374px; height:40px; z-index:0"><img src="/images/row1.jpg" alt="" title="" border=0 width=374 height=50></div> </body> </html> I am using the row1 as per image to resize it for per programme, but i have no idea how i can compare with each timing for per programme before resizing on per image. here is what my php displaying: <span id='time1'>1:00 PM</span> - <span id='title1'>SportsCenter</span><br></br><span id='time2'>2:00 PM</span> - <span id='title2'>SportsCenter</span><br></br><span id='time3'>3:00 PM</span> - <span id='title3'>SportsCenter Special: On the Clock</span><br></br><span id='time4'>4:00 PM</span> - <span id='title4'>NFL Live</span><br></br> I want to know how to work it out on per timing how long the programme will last for, e.g I want to work it out between time1 and time2 to find out how long it will last which it make 60 mins. Does anyone know how i can compare with each timing on per programme before resizing on per image? Any advice would be much appreicated. Thanks in advance
  4. Yes, BUT I SAID I WANT TO SCRAPE THE TITLE THAT IS ON TODAY IN THE CURRENT TIME UNTIL TO THE END OF THE PAGE AND NOT YESTERDAY. I WANT TO DISPLAY THEM IN MY PHP: The USA current time is 10:00PM 10:00 PM Baseball Tonight LIVE 11:00 PM SportsCenter LIVE Tomorrow 12:00 AM SportsCenter LIVE 1:00 AM SportsCenter LIVE 2:00 AM SportsCenter LIVE 3:00 AM SportsCenter 4:00 AM SportsCenter Not like this: ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - Around the Horn ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - Pardon the Interruption ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter Special (Last Night-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter Special: On the Clock (Last Night-7:00 PM) Dec 31, 1969 7:00PM - NFL Live (Last Night-7:00 PM) Dec 31, 1969 7:00PM - Baseball Tonight (Last Night-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter ( Today-7:00 PM) Dec 31, 1969 7:00PM - Outside the Lines ( Today-7:00 PM) Dec 31, 1969 7:00PM - College Football Live Are you thick???????
  5. Thanks, I have input the code in my php and I saw the list of title included the time. You have got it wrong there and you don't understand what I want to achieve. Let me explain to you again. I want to scrape the data in the current time in the USA that are 5 hours behind my current time which my current time is 3:00am and the usa time is 10:00pm. Please see the data that show in the programme current time like this: 10:00 PM Baseball Tonight LIVE 11:00 PM SportsCenter LIVE Tomorrow 12:00 AM SportsCenter LIVE 1:00 AM SportsCenter LIVE 2:00 AM SportsCenter LIVE 3:00 AM SportsCenter 4:00 AM SportsCenter Now I hope you get my point?
  6. on the day like today to wednesday.
  7. I come from the UK so I don't know how to use cURL to get the timezone before scraping the right data in the same row as the time that match my current time. There is no other website I can use, this is the only one I can use. Could you please help?
  8. thanks, could you please post the code that i could use cURL or strtotime to get the correct time 5 hours back from my current time to get the correct data in that website, e.g my current time is 10pm and i look for the time that is 5 hours backward which it is 5pm and get the data that show at 5pm??
  9. thanks for your help. I can't be able to output the correct data in current time, e.g my local time is 9:00pm and the current time for the data is 4:00pm. I can only output the data before the current time. can you help?
  10. Thanks but it still show no data output. Please fix the code.
  11. Thanks, that is what i really want but the problem is it will ouput the href link. I only want to output the text without the href. Do you know how i can extract the text to output in my php without the href link?
  12. thanks you very much for your help, but there is a problem. There is no output data when I am using this: <?php $data = file_get_contents('http://tvlistings.zap2it.com/tvlistings/ZCSGrid.do?stnNum=10179'); $p = "/a id='rowTitle1' class='zc-ssl-pg-title'>(.*)<\/a>/"; preg_match($p, $html, $match); echo $match[0]; ?> i am not really sure if i have done it wrong. can you help?
  13. yeah I am looking for to match the data, could you please post the source for variable that I am looking for to match the data and then to output them to my php?
  14. Hi, I am having a problem with scraping the data from the website. I can't be able to output the data to my php after I have scraping the data from the website. On my php it show as a empty page. here is the html source I want to scrape: <span id="row3Time" class="zc-ssl-pg-time">11:00 AM</span> <a id="rowTitle3" class="zc-ssl-pg-title" href='http://tvlistings.zap2it.com/tv/sportscenter/EP00019917'>SportsCenter</a> <ul class="zc-icons"> <li class="zc-ic zc-ic-span"><span class="zc-ic-live">LIVE</span></li></ul> </li> <li class="zc-ssl-pg" id="row1-4" style=""> <span id="row4Time" class="zc-ssl-pg-time">12:00 PM</span> <a id="rowTitle4" class="zc-ssl-pg-title" href='http://tvlistings.zap2it.com/tv/sportscenter/EP00019917'>SportsCenter</a> <ul class="zc-icons"> <li class="zc-ic zc-ic-span"><span class="zc-ic-live">LIVE</span></li></ul> </li> <li class="zc-ssl-pg" id="row1-5" style=""> <span id="row5Time" class="zc-ssl-pg-time">1:00 PM</span> <a id="rowTitle5" class="zc-ssl-pg-title" href='http://tvlistings.zap2it.com/tv/sportscenter/EP00019917'>SportsCenter</a> <ul class="zc-icons"> <li class="zc-ic zc-ic-span"><span class="zc-ic-live">LIVE</span></li></ul> here is the php source: <?php $contents = file_get_contents('http://tvlistings.zap2it.com/tvlistings/ZCSGrid.do?stnNum=10179'); preg_match('/<a id="rowTitle3" class="zc-ssl-pg-title"[.*]<\/a>/i', $data, $matches); $rowtitle = $matches[1]; echo $rowtitle."<br>\n"; ?> And here is the php output: <br> does anyone know how I can scraping the data from that website using with <a id=rowTitle3 to the end of the page? any advice would be much appreicated. Thanks in advance
  15. I want to put the data into an array before outputting it. Any idea?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.