MyEpisodes Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HOWTO: add MyEpisodes to google calendar
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    MyEpisodes Forum Index -> User Contributions
View previous topic :: View next topic  
Author Message
clueo8


Posts: 6

PostPosted: Tue Dec 16, 2008 1:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
denes44


Posts: 7

PostPosted: Sun Dec 28, 2008 11:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
clueo8


Posts: 6

PostPosted: Thu Jan 01, 2009 5:15 am    Post subject: Reply with quote

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
View user's profile Send private message
denes44


Posts: 7

PostPosted: Thu Jan 01, 2009 4:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
clueo8


Posts: 6

PostPosted: Thu Jan 01, 2009 7:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
denes44


Posts: 7

PostPosted: Sat Jan 03, 2009 6:59 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
thesmile


Posts: 1

PostPosted: Sat Feb 28, 2009 6:05 pm    Post subject: Reply with quote

[deleted]
Back to top
View user's profile Send private message
Braedley


Posts: 1

PostPosted: Fri Mar 20, 2009 12:24 am    Post subject: Reply with quote

@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
View user's profile Send private message
clickity


Posts: 1

PostPosted: Wed Apr 22, 2009 10:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hozefa


Posts: 1

PostPosted: Wed Sep 30, 2009 10:20 pm    Post subject: Nokia N818gB Reply with quote

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
View user's profile Send private message
Enrico


Posts: 2

PostPosted: Tue Oct 06, 2009 10:41 am    Post subject: Reply with quote

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
View user's profile Send private message
Jorgensen


Posts: 3

PostPosted: Tue Dec 01, 2009 8:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jorgensen


Posts: 3

PostPosted: Tue Dec 01, 2009 8:56 pm    Post subject: Reply with quote

And using denes44 modified script you get the timestamp as well Smile
Back to top
View user's profile Send private message
SweetthD3ViL


Posts: 2

PostPosted: Mon Jan 04, 2010 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
jamesking


Posts: 25

PostPosted: Wed Jan 06, 2010 11:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
jamesking


Posts: 25

PostPosted: Thu Jan 07, 2010 12:10 am    Post subject: Reply with quote

Well,

Sunkast's link suddenly started working for me (it had not been!).

This is great Smile

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 Smile

This is awesome Smile
Back to top
View user's profile Send private message
jamesking


Posts: 25

PostPosted: Thu Jan 07, 2010 12:34 pm    Post subject: Summary of this thread and instructions for use! Reply with quote

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 Smile


Last edited by jamesking on Mon Apr 19, 2010 9:28 am; edited 1 time in total
Back to top
View user's profile Send private message
SweetthD3ViL


Posts: 2

PostPosted: Sat Jan 09, 2010 12:02 pm    Post subject: Reply with quote

Right,

can the fixed version be upload again, as all links in this topic are dead.

Many thanks
Back to top
View user's profile Send private message
jamesking


Posts: 25

PostPosted: Sat Jan 09, 2010 12:10 pm    Post subject: Reply with quote

No they're not, this link works:

http://www.jamesking.co.uk/myepisodes/RSStoiCal.zip
Back to top
View user's profile Send private message
gareth72


Posts: 1

PostPosted: Sun Jan 10, 2010 8:27 pm    Post subject: Reply with quote

Thanks jamesking for your tutorial. I now have it working perfectly. It syncs to my phone aswell so that's a bonus Smile
Back to top
View user's profile Send private message
cowai


Posts: 1

PostPosted: Wed Feb 03, 2010 9:43 pm    Post subject: Which web host? Reply with quote

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
View user's profile Send private message
fruityth1ng


Posts: 1

PostPosted: Fri Feb 05, 2010 7:28 pm    Post subject: Sweet! Reply with quote

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! Smile


*THANKS*
Back to top
View user's profile Send private message
jamesking


Posts: 25

PostPosted: Tue Feb 16, 2010 6:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
mazz0310


Posts: 31

PostPosted: Fri Apr 09, 2010 4:07 am    Post subject: Reply with quote

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
View user's profile Send private message
mazz0310


Posts: 31

PostPosted: Fri Apr 09, 2010 4:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MyEpisodes Forum Index -> User Contributions All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
Jump to:  
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.