|
|
View previous topic :: View next topic |
Author |
Message |
clueo8
Posts: 6
|
Posted: Tue Dec 16, 2008 1:21 pm Post subject: |
|
|
I have noticed that MyEpisodes now has the start time of a show in the RSS feed. When using the myepisodes2ical.php from this forum, it creates shows as all day events for the day the show airs. Is it possible for someone to update the code to support start/end times for shows? |
|
Back to top |
|
|
denes44
Posts: 7
|
Posted: Sun Dec 28, 2008 11:39 pm Post subject: |
|
|
clueo8 wrote: | I have noticed that MyEpisodes now has the start time of a show in the RSS feed. When using the myepisodes2ical.php from this forum, it creates shows as all day events for the day the show airs. Is it possible for someone to update the code to support start/end times for shows? |
Here is the modified part of the script which using SimplePie RSS parser:
Code: |
$half_hour_shows = array("The IT Crowd");
foreach ($feed->get_items() as $item) {
$i++;
// fix for Repetition problem
$icalevent = new iCalendar_event;
$title_data = parseTitle($item->get_title());
preg_match('/Air Time:<\/b><\/td><td>(\\d{2}:\\d{2})<\/td>/', $item->get_description(), $regs);
$date1 = date("Ymd\THis", strtotime($title_data[3]." ".$regs[1]));
$date2 = date("Ymd\THis", strtotime($title_data[3]." ".$regs[1].(in_array($title_data[0],$half_hour_shows)?" + 30 minutes":" + 1 hour")));
$date3 = date("Ymd\THis\Z", strtotime($title_data[3]." ".$regs[1]));
// Start-end date
$icalevent->add_property('class', 'PUBLIC');
$icalevent->add_property('sequence', $i);
$icalevent->add_property('dtstart', $date1, array('value' => 'DATE-TIME'));
$icalevent->add_property('dtend', $date2, array('value' => 'DATE-TIME'));
$icalevent->add_property('dtstamp', $date3);
$icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
$icalevent->add_property('description', $title_data[2]);
// fix for UID problem
$icalevent->add_property('uid', md5($date3.$title_data[0].$title_data[1]));
$ical->add_component($icalevent);
} |
Only the foreach is modified, and 1 row added before the start of foreach.
You should manually specify the 30 minutes-long shows in the files, or the default length will be 1 hour.[/quote] |
|
Back to top |
|
|
clueo8
Posts: 6
|
Posted: Thu Jan 01, 2009 5:15 am Post subject: |
|
|
This is great! I could not get the 30 minute shows to work... I personally have more 30 minute shows then 1 hour long shows and would prefer the reverse... I attempted to switch the 30 minutes and the 1 hour but it still resorts to 1 hour. Any help? Thanks again! |
|
Back to top |
|
|
denes44
Posts: 7
|
Posted: Thu Jan 01, 2009 4:04 pm Post subject: |
|
|
clueo8 wrote: | This is great! I could not get the 30 minute shows to work... I personally have more 30 minute shows then 1 hour long shows and would prefer the reverse... I attempted to switch the 30 minutes and the 1 hour but it still resorts to 1 hour. Any help? Thanks again! |
This is the modified code for the 30-minute shows:
Code: | <?php
$one_hour_shows = array("Fringe","Lost","Prison Break","...");
foreach ($feed->get_items() as $item) {
$i++;
// fix for Repetition problem
$icalevent = new iCalendar_event;
$title_data = parseTitle($item->get_title());
preg_match('/Air Time:<\/b><\/td><td>(\\d{2}:\\d{2})<\/td>/', $item->get_description(), $regs);
$date1 = date("Ymd\THis", strtotime($title_data[3]." ".$regs[1]));
$date2 = date("Ymd\THis", strtotime($title_data[3]." ".$regs[1].(in_array($title_data[0],$one_hour_shows)?" + 1 hour":" + 30 minutes")));
$date3 = date("Ymd\THis\Z", strtotime($title_data[3]." ".$regs[1]));
// Start-end date
$icalevent->add_property('class', 'PUBLIC');
$icalevent->add_property('sequence', $i);
$icalevent->add_property('dtstart', $date1, array('value' => 'DATE-TIME'));
$icalevent->add_property('dtend', $date2, array('value' => 'DATE-TIME'));
$icalevent->add_property('dtstamp', $date3);
$icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
$icalevent->add_property('description', $title_data[2]);
// fix for UID problem
$icalevent->add_property('uid', md5($date3.$title_data[0].$title_data[1]));
$ical->add_component($icalevent);
}
?< |
The default length is 30 minutes, and you should list the one hour long shows in the array at the top of the code. |
|
Back to top |
|
|
clueo8
Posts: 6
|
Posted: Thu Jan 01, 2009 7:28 pm Post subject: |
|
|
Thanks for the quick reply... This worked for me... I had to re-add it to my calendar program to pick up the changes... a simple refresh didn't do it for me. Thanks again! |
|
Back to top |
|
|
denes44
Posts: 7
|
Posted: Sat Jan 03, 2009 6:59 pm Post subject: |
|
|
I'm generating a list from tvrage.com from all of the 30 mintues shows for the script.
I've done A-G letters, and there are 2400 shows in the list |
|
Back to top |
|
|
thesmile
Posts: 1
|
Posted: Sat Feb 28, 2009 6:05 pm Post subject: |
|
|
[deleted] |
|
Back to top |
|
|
Braedley
Posts: 1
|
Posted: Fri Mar 20, 2009 12:24 am Post subject: |
|
|
@saxx
I tried your converter, but I get an error page instead of the expected iCal calendar. Unfortunately, I can't read (what I assume to be) German, so I can't tell what's wrong. According to google's translation, it's an error that's only displayed on local computers. |
|
Back to top |
|
|
clickity
Posts: 1
|
Posted: Wed Apr 22, 2009 10:49 pm Post subject: |
|
|
Can someone please help?
There have been so many different versions of this script posted, and I'm honestly lost.
I have my own server at clickity.net. It's hosted by MidPhase, and to my knowledge I have PHP. First off, does anyone know if MobileMe has PHP? I'm considering switching, keeping the domain of course.
For the time being, I can't get this to work.
So which script should I download?
What lines from the rsshelp.php page do I need?
Here's my sample line:
?feed=[Feed]&uid=clickity&pwdmd5=7d9b27bbe5aaf05d7e7350e5ca19a675
It doesn't seem to work in iCal, or gCal.
Maybe I'm missing a step. Is it possible for someone to give a step-by-step, simply guideline for making this work?
I'd appreciate any help. Thanks. |
|
Back to top |
|
|
Hozefa
Posts: 1
|
Posted: Wed Sep 30, 2009 10:20 pm Post subject: Nokia N818gB |
|
|
Thx SAXX for the link (pg1).
Thx to him/her I have directly Suscribed it to my windows Calender application. I will update it every 2 months.
the only problem I have is that when i sync it with my Nokia N81 8 GB. nothing shows up in the calender of my cell phone. I dunno why, the format of the event is same as on my personal calender.
Is it possible to 'merge' My personal calendar and the Episodes Calendar in windows calendar?
If you guys wanna know how i Suscribed it to my windows Calender application then feel free to message me. |
|
Back to top |
|
|
Enrico
Posts: 2
|
Posted: Tue Oct 06, 2009 10:41 am Post subject: |
|
|
I can only see one show (1 episode for that show.) in my calendar...(though I have more than one show configured in the site)
Is the rar file with the most recent bug free version?
Thanks.
Awesome idea btw... |
|
Back to top |
|
|
Jorgensen
Posts: 3
|
Posted: Tue Dec 01, 2009 8:50 pm Post subject: |
|
|
I have just used Henrik_DK's version and that works for me. Still the shows don't have a start and end time. |
|
Back to top |
|
|
Jorgensen
Posts: 3
|
Posted: Tue Dec 01, 2009 8:56 pm Post subject: |
|
|
And using denes44 modified script you get the timestamp as well |
|
Back to top |
|
|
SweetthD3ViL
Posts: 2
|
Posted: Mon Jan 04, 2010 6:58 pm Post subject: |
|
|
Hi there man thanks for your script,
I use the same configuration as original
Code: | $config["myepisodes_url"] = "http://www.myepisodes.com/rss.php?feed=mylist&uid=%1&pwdmd5=%2";
|
I have couples of TvShow and the results of the script only created one events for one TvShow only and not even the next one.
However when I check the RSS feed for mylist&uid they are all there as desired.
I have also check the configuration for the backward/forward details and they are good.
Many thanks. |
|
Back to top |
|
|
jamesking
Posts: 25
|
Posted: Wed Jan 06, 2010 11:45 pm Post subject: |
|
|
I am looking for Henrik_DK's version of the script, but unfortunately I cannot find it. If anyone could send it to me, I'd be most grateful. I will then host it (as Herik_DK's version is no longer there), as long asthere are no objections?
Thanks,
James |
|
Back to top |
|
|
jamesking
Posts: 25
|
Posted: Thu Jan 07, 2010 12:10 am Post subject: |
|
|
Well,
Sunkast's link suddenly started working for me (it had not been!).
This is great
I then added in the changes to get the exact times of the shows, posted by denes44 added it to my google calendar no problem. Thanks so much
This is awesome |
|
Back to top |
|
|
jamesking
Posts: 25
|
Posted: Thu Jan 07, 2010 12:34 pm Post subject: Summary of this thread and instructions for use! |
|
|
SUMMARY OF THIS THREAD AND INSTRUCTIONS FOR USE!
Only after reading this thread about 4 times, did I realise what's going on! I also found it pretty hard to figure it out on the first few walk throughs as I am not a coding expert and am new to MyEpisodes.
This script converts the My Episodes RSS feeds in to an iCal format for use with Google Calendar (and I assume other iCal compatible calendars).
Mayco originally uploaded a php script, which, when uploaded to your own web hosting will give you an iCal URL that you can add to Google calendar.
THEMike and nosnhojm proposed fixes.
sunkast re-wrote the script and re-upped using SimplePie instead of LastRSS.
Henrik_DK fixed sunkast's script for the same problems that THEMike and nosnhojm had found.
The fixed version of sunkast's script is still available from sunkast's website.
denes44 proposed a change to sunkast's that gives the exact times of the episodes, rather than just the day they are on.
I have subsequently integrated this into the code, and added a line which adds the TV Rage URL to the "Location" property of the iCal entries. (since the location is not used for anything else!)
Here are the instructions on getting it working.
Instructions for use wrote: |
Download the .zip here
Unzip all files to a folder and open the myepisodes2ical.php file in Notepad.
Go to the 20th line:
$feed->set_feed_url('REPLACE_THIS_TEXT_WITH_YOUR_RSS_URL');
replace REPLACE_THIS_TEXT_WITH_YOUR_RSS_URL with your RSS feed from here. (the single quote marks must stay)
This line should now look something like this:
$feed->set_feed_url(http://www.myepisodes.com/rss.php?feed=mylist&onlyunacquired=1&uid=jamesking&pwdmd5=45f0b16f16ff9c7ee27f0b16f27dda27d5f0bc');
If you watch any half hour TV shows, make sure they're added to the array for half hour shows in row 33. They need to be seperated with commas _ , _ and have double quotes around each show name _ " _ .
E.g., change:
$half_hour_shows = array("The IT Crowd","Friends");
to:
$half_hour_shows = array("The IT Crowd","Friends","Eastenders","Scrubs","How I Met Your Mother");
Upload the entire zipped contents, including your modified .php file to a folder in your web server.
CHMOD the properties of the "cache" folder to 777. Note, I do not know exactly what this means (something to do with permissions), but it appears to be a neccessary requirement to make the script work. I found it easy to do in the Flashfxp FTP program that I use.
In Google Calendar, under Other calendars, click "Add", "Add by URL", and point to the .php file that you have just updated. E.g., enter a link similar to the following:
http://www.jamesking.com/myepisodes/myepisodes2ical.php
Now click "Add calendar" and the episodes on your RSS feed should be displayed. I use mine to show only "unacquired" files in the past 30 days, or next 45 on my google calendar.
|
If you don't have your own webspace, the alternative is to use the kind offer by Saxx of using their ASP script.
To do this, add the following URL to Google Calendar:
http://www.sachsenhofer.com/stuff/myepisodestoical.aspx?uid=YOURUSER&pwdmd5=YOURMD5PWD
but change "YOURUSER" to your username, and change "[
YOURMD5PWD" to your MD5 password (these can both be seen here
Any questions, let me know
Last edited by jamesking on Mon Apr 19, 2010 9:28 am; edited 1 time in total |
|
Back to top |
|
|
SweetthD3ViL
Posts: 2
|
Posted: Sat Jan 09, 2010 12:02 pm Post subject: |
|
|
Right,
can the fixed version be upload again, as all links in this topic are dead.
Many thanks |
|
Back to top |
|
|
jamesking
Posts: 25
|
|
Back to top |
|
|
gareth72
Posts: 1
|
Posted: Sun Jan 10, 2010 8:27 pm Post subject: |
|
|
Thanks jamesking for your tutorial. I now have it working perfectly. It syncs to my phone aswell so that's a bonus |
|
Back to top |
|
|
cowai
Posts: 1
|
Posted: Wed Feb 03, 2010 9:43 pm Post subject: Which web host? |
|
|
I have tried with 3 web hosts, everyone of them giving different error.
cURL error 7, require_once and one with nothing happend.
Which web host have you gotten to work? Any free?
Tried with a commercial host, freehostia and 000webhost.
Help |
|
Back to top |
|
|
fruityth1ng
Posts: 1
|
Posted: Fri Feb 05, 2010 7:28 pm Post subject: Sweet! |
|
|
on OSX, I only had to enable this in @/private/etc/apache2 - and copy a php.ini from it`s .default - pop these files in, minor edit, done! Yay!
*THANKS* |
|
Back to top |
|
|
jamesking
Posts: 25
|
Posted: Tue Feb 16, 2010 6:26 pm Post subject: |
|
|
Well I have this synced to my google calendar, and therefore to my android phone. I therefore use it quite a lot, and have subsequently spotted an ERROR!! Shock, horror!
Basically, I noticed that two episodes of Damages weren't showing in my Google Calendar.
After a bit of looking at the "myepisodes2ical.php" on my web server, I found that the reason may be because of apostrophes in the event description (there were apostrophes in the episode name). I also subscribe to "Grey's Anatomy" and interestingly, Google Calendar correctly dealt with apostrophes in the show title (event title).
So I went about trying to fix it. I think I've done it and I think it was very easy. As yet, Google Calendar hasn't refreshed my feed, so I'm not 100% certain that they will show properly in Google Calendar, but if they do, I'll post an updated RSStoiCal.zip file some time in the next week. Essentially, all I did was add the following two lines of code:
Addtional Code wrote: |
// Fix for apostrophe problem
$title_data[2] = str_replace("'", '', $title_data[2]); |
in between these two lines:
Quote: | $icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
$icalevent->add_property('description', $title_data[2]); |
to leave me with this fixed code: Fixed Code wrote: |
$icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
// Fix for apostrophe problem
$title_data[2] = str_replace("'", '', $title_data[2]);
$icalevent->add_property('description', $title_data[2]); |
It appears to have done the trick as the "myepisodes2ical.php" file, when viewed in a web browser looks to be identical, except without the apostrophes that were causing the problem. (basically these extra lines just replace the apostrophes with nothing/blank.)
I'll post back here when I know more, and post a fixed version of the RSStoiCal.zip when I get back home (working away from home!) |
|
Back to top |
|
|
mazz0310
Posts: 31
|
Posted: Fri Apr 09, 2010 4:07 am Post subject: |
|
|
jamesking wrote: | Well I have this synced to my google calendar, and therefore to my android phone. I therefore use it quite a lot, and have subsequently spotted an ERROR!! Shock, horror!
Basically, I noticed that two episodes of Damages weren't showing in my Google Calendar.
After a bit of looking at the "myepisodes2ical.php" on my web server, I found that the reason may be because of apostrophes in the event description (there were apostrophes in the episode name). I also subscribe to "Grey's Anatomy" and interestingly, Google Calendar correctly dealt with apostrophes in the show title (event title).
So I went about trying to fix it. I think I've done it and I think it was very easy. As yet, Google Calendar hasn't refreshed my feed, so I'm not 100% certain that they will show properly in Google Calendar, but if they do, I'll post an updated RSStoiCal.zip file some time in the next week. Essentially, all I did was add the following two lines of code:
Addtional Code wrote: |
// Fix for apostrophe problem
$title_data[2] = str_replace("'", '', $title_data[2]); |
in between these two lines:
Quote: | $icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
$icalevent->add_property('description', $title_data[2]); |
to leave me with this fixed code: Fixed Code wrote: |
$icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
// Fix for apostrophe problem
$title_data[2] = str_replace("'", '', $title_data[2]);
$icalevent->add_property('description', $title_data[2]); |
It appears to have done the trick as the "myepisodes2ical.php" file, when viewed in a web browser looks to be identical, except without the apostrophes that were causing the problem. (basically these extra lines just replace the apostrophes with nothing/blank.)
I'll post back here when I know more, and post a fixed version of the RSStoiCal.zip when I get back home (working away from home!) |
A few months old but I'm still only getting 1 show, and only one episode. I'm not too sure what I did wrong....anyone have any advice? |
|
Back to top |
|
|
mazz0310
Posts: 31
|
Posted: Fri Apr 09, 2010 4:47 am Post subject: |
|
|
mazz0310 wrote: | jamesking wrote: | Well I have this synced to my google calendar, and therefore to my android phone. I therefore use it quite a lot, and have subsequently spotted an ERROR!! Shock, horror!
Basically, I noticed that two episodes of Damages weren't showing in my Google Calendar.
After a bit of looking at the "myepisodes2ical.php" on my web server, I found that the reason may be because of apostrophes in the event description (there were apostrophes in the episode name). I also subscribe to "Grey's Anatomy" and interestingly, Google Calendar correctly dealt with apostrophes in the show title (event title).
So I went about trying to fix it. I think I've done it and I think it was very easy. As yet, Google Calendar hasn't refreshed my feed, so I'm not 100% certain that they will show properly in Google Calendar, but if they do, I'll post an updated RSStoiCal.zip file some time in the next week. Essentially, all I did was add the following two lines of code:
Addtional Code wrote: |
// Fix for apostrophe problem
$title_data[2] = str_replace("'", '', $title_data[2]); |
in between these two lines:
Quote: | $icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
$icalevent->add_property('description', $title_data[2]); |
to leave me with this fixed code: Fixed Code wrote: |
$icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
// Fix for apostrophe problem
$title_data[2] = str_replace("'", '', $title_data[2]);
$icalevent->add_property('description', $title_data[2]); |
It appears to have done the trick as the "myepisodes2ical.php" file, when viewed in a web browser looks to be identical, except without the apostrophes that were causing the problem. (basically these extra lines just replace the apostrophes with nothing/blank.)
I'll post back here when I know more, and post a fixed version of the RSStoiCal.zip when I get back home (working away from home!) |
A few months old but I'm still only getting 1 show, and only one episode. I'm not too sure what I did wrong....anyone have any advice? |
Sorry I don't see an edit button, but I just copied the wrong file some how, working now. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
Main design by MW. Refitted to board by Hostile.
|