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
joesparano


Posts: 53

PostPosted: Thu May 10, 2007 1:55 am    Post subject: Reply with quote

I'm not certain that this is the cause, but I would often get duplicate entires using my PC's sleep mode while running Gcal. The entires would usually show up when the machine was "awakened".
Back to top
View user's profile Send private message
nosnhojm


Posts: 2

PostPosted: Thu May 10, 2007 3:45 am    Post subject: Reply with quote

I had this problem also, and I believe it is because the current script generates random UID numbers each time it is executed, and google must get confused as to the uniqueness of each event. I fixed this by adding an additional line to the script that explicitly specifies a static (but still unique) UID to each event:

Code:

$icalevent->add_property('uid', md5($date3.$item['link']));


so that it now looks like:

Code:

    ...
    $icalevent->add_property('uid', md5($date3.$item['link']));
    $ical->add_component($icalevent);
    $icalevent = new iCalendar_event;
  }


Keep in mind, google calendar only updates its caches version of the calendar every 3 hours, so you won't see any changes immediately.
Back to top
View user's profile Send private message
Telecart


Posts: 9

PostPosted: Sat May 12, 2007 11:54 pm    Post subject: Reply with quote

Er.. Nowhere does my code look like that, but i'll give it a shot.



EDIT: Doesn't seem to help, my google calendar looks pretty ridiculous with dozens of duplicates now :/ I don't get it. Other calendar apps like Netvibes Calendar don't seem to have this problem at all.
Back to top
View user's profile Send private message
domike


Posts: 1

PostPosted: Tue May 15, 2007 4:57 am    Post subject: Reply with quote

I am also having the duplicates problem. Any assistance would be appreciated.
Back to top
View user's profile Send private message
munki


Posts: 2

PostPosted: Thu May 24, 2007 5:01 pm    Post subject: Reply with quote

Only just seen this topic and i have been trying various things for the past 30 minutes with this php code. I'm no simpleton in the area but I'm not seeing why this script is caught in some sort of infinite loop even on an empty rss feed.
Apache/2.0.55 and PHP/4.4.2
Any ideas?
Back to top
View user's profile Send private message
markild


Posts: 6

PostPosted: Sun Jun 17, 2007 3:25 pm    Post subject: Reply with quote

Works great!

Thanks mate Very Happy
Back to top
View user's profile Send private message
Telecart


Posts: 9

PostPosted: Tue Aug 21, 2007 9:27 am    Post subject: hmph Reply with quote

This seems to have mysteriously stopped working.

Manually loading the php gives me :

"Error: RSS file not found!"

Anyone else encountering this?

EDIT: Apparantly this started happening a couple of weeks after I moved hosts. New host has a newer version of PHP, which I guess clashes with the script. Found a free web host which works, issue resolved.
Back to top
View user's profile Send private message
sunkast


Posts: 5

PostPosted: Fri Sep 28, 2007 12:43 am    Post subject: Reply with quote

Can't seem to get the script working. All I get is "Error: RSS file not found!" when trying to view the address. I am running other php scripts with no problem on my site. Anyone have ideas on how to resolve this?
Back to top
View user's profile Send private message
Telecart


Posts: 9

PostPosted: Fri Sep 28, 2007 4:20 pm    Post subject: Reply with quote

Perhaps it's a matter of versions of PHP, because I had the same issue on my server, which also runs .php.
It must be conflicting with newer versinos I imagine, as the script has not been updated since forever.

Try freehostia.com, and post back let us know if it resolved the issue for you..
Back to top
View user's profile Send private message
sunkast


Posts: 5

PostPosted: Fri Sep 28, 2007 4:59 pm    Post subject: Reply with quote

Thanks Telecart, that works. However I'm still not sure as to why. On my site I am running PHP version 4.4.7, on FreeHostia, they're running version 4.4.0. Not that significant difference in versions. I'd still be interested in knowing why it doesn't work. But at least now I have it working somewhere else.
Back to top
View user's profile Send private message
lazyjunk


Posts: 2

PostPosted: Sun Oct 14, 2007 2:21 am    Post subject: Reply with quote

THEmike

Thanks for the tip, adding that line after line 69 made it work in Apple's iCal Smile

side note: has anyone been able to figure out how to get rid of the characters that show up for single quotes?
Back to top
View user's profile Send private message
hanzoh


Posts: 1

PostPosted: Mon Nov 12, 2007 11:21 pm    Post subject: Reply with quote

I've been using saxx' "service" for quite some time now.
As ME added the function of exact times this weekend, woudl it be possible to include this as well in the script?

Thanks, and great work!

Chris
Back to top
View user's profile Send private message
Telecart


Posts: 9

PostPosted: Tue Nov 20, 2007 9:42 pm    Post subject: Reply with quote

sunkast wrote:
Thanks Telecart, that works. However I'm still not sure as to why. On my site I am running PHP version 4.4.7, on FreeHostia, they're running version 4.4.0. Not that significant difference in versions. I'd still be interested in knowing why it doesn't work. But at least now I have it working somewhere else.



Seems freehostia broke. They must've upgraded their php. Any other free hosts? Or perhaps someone willing/capable of upgrading the code?
Back to top
View user's profile Send private message
sunkast


Posts: 5

PostPosted: Tue Dec 04, 2007 12:34 am    Post subject: Reply with quote

Telecart wrote:
Seems freehostia broke. They must've upgraded their php. Any other free hosts? Or perhaps someone willing/capable of upgrading the code?


I rewrote the code to use SimplePie instead of LastRSS. This script now works on my own server. It however does not seem to work on Freehostia still. Not sure why or what changed where. I emailed Freehostia about it and their tech support sucked. Said they didn't make any server changes and couldn't help me any more since the script was fetching an RSS feed that wasn't hosted by them. So here is a link to the script I am not using. Let me know if it works for anyone.

Be sure to edit myepisodes2ical.php to use the complete URL to your MyEpisodes RSS feed.

http://sunkast.freehostia.com/myepisodes2ical.zip


Last edited by sunkast on Sun Aug 24, 2008 5:11 pm; edited 2 times in total
Back to top
View user's profile Send private message
Telecart


Posts: 9

PostPosted: Tue Dec 04, 2007 1:08 am    Post subject: Reply with quote

Thanks! Works on my website!
Back to top
View user's profile Send private message
b818283


Posts: 1

PostPosted: Sat Dec 15, 2007 1:21 am    Post subject: Need help converting rss feed to ical Reply with quote

Can Someone please help me put my rss feed to calendar? I tried using the two scripts. The first error says it cannot find the rss feed. The other error sys it cannot access my server.
My PHP file is located here
http://gary.athost.net/myepisodes2ical.php

here is the copy of my php file.
(I put X's for the password)


Thank you for the help.

<?php

/* == CONFIG ================================================================ */

$config["myepisodes_username"] = "b818283";
$config["myepisodes_md5password"] = "xxxx";

$config["myepisodes_url"] = "http://www.myepisodes.com/rss.php?feed=today&uid=b818283&pwdmd5=xxxx";

/* ========================================================================== */

error_reporting(E_ALL);

// Parsing of RSS files (http://lastrss.webdot.cz/)
include('lastRSS/lastRSS.php');

// Creating of iCal files (http://bennu.sourceforge.net/)
include('bennu/lib/bennu.inc.php');

// construct the URL
$url = $config["myepisodes_url"];
$url = str_replace("%1", $config["myepisodes_username"], $url);
$url = str_replace("%2", $config["myepisodes_md5password"], $url);

$rss = new lastRSS;
$rss->cache_dir = './cache';
$rss->cache_time = 3600; // one hour

if ($rs = $rss->get($url)) {

$ical = new iCalendar;
$icalevent = new iCalendar_event;

// $rs[items_count]
// $rs[cached]
// $rs[encoding]
// $rs[title]
// $rs[link]
// $rs[description]
// $rs[items]
// $rs[language]
// $rs[image_title]
// $rs[image_url]
// $rs[image_link]

$i = 0;
foreach($rs['items'] as $item) {
$i++;
// $item['title']
// $item['link']
// $item['description']

$title_data = parseTitle($item['title']);
$date1 = date("Ymd", strtotime($title_data[3]));
$date2 = date("Ymd", strtotime($title_data[3]." + 1 day"));
$date3 = date("Ymd\THis\Z", strtotime($title_data[3]));

// Start-end date
$icalevent->add_property('class', 'PUBLIC');
$icalevent->add_property('sequence', $i);

$icalevent->add_property('dtstart', $date1, array('value' => 'DATE'));
$icalevent->add_property('dtend', $date2, array('value' => 'DATE'));
$icalevent->add_property('dtstamp', $date3);

$icalevent->add_property('summary', $title_data[0]." ".$title_data[1]);
$icalevent->add_property('description', $title_data[2]);

$ical->add_component($icalevent);
}
echo $ical->serialize();
}
else {
die('Error: RSS file not found!');
}

function Return_Substrings($text, $sopener, $scloser) {
$result = array();

$noresult = substr_count($text, $sopener);
$ncresult = substr_count($text, $scloser);

if ($noresult < $ncresult)
$nresult = $noresult;
else
$nresult = $ncresult;

unset($noresult);
unset($ncresult);

for ($i=0;$i<$nresult;$i++) {
$pos = strpos($text, $sopener) + strlen($sopener);
$text = substr($text, $pos, strlen($text));
$pos = strpos($text, $scloser);
$result[] = substr($text, 0, $pos);
$text = substr($text, $pos + strlen($scloser), strlen($text));
}
return $result;
}

function parseTitle($title) {
// format: [ Episode title ][ Episode Number ][ Episode Name ][ 15-May-2006 ]
return Return_Substrings($title, "[ ", " ]");
}

?>
Back to top
View user's profile Send private message
Henrik_DK


Posts: 1

PostPosted: Wed Jan 09, 2008 9:50 pm    Post subject: Reply with quote

Soo... tried using sunkast's new version of the script but it was missing fixes for a few of the known problems with the old script. My first results from that script was just the same episode repeating it self 20 or so times, so i've fixed the script and it can be found here:
http://tobiasserver.ath.cx/henrik/myepisodes2ical.fixed.zip

My fix is just two lines one at the begining of the foreach loop and one almost at the end...

Code:

  foreach ($feed->get_items() as $item) {
    $i++;

   // fix for Repetition problem
    $icalevent = new iCalendar_event;
   
    $title_data = parseTitle($item->get_title());
    $date1 = date("Ymd", strtotime($title_data[3]));
    $date2 = date("Ymd", strtotime($title_data[3]." + 1 day"));
    $date3 = date("Ymd\THis\Z", strtotime($title_data[3]));

    // Start-end date
    $icalevent->add_property('class', 'PUBLIC');
    $icalevent->add_property('sequence', $i);
   
    $icalevent->add_property('dtstart', $date1, array('value' => 'DATE'));
    $icalevent->add_property('dtend',   $date2, array('value' => 'DATE'));
    $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);
  }


Hope this is usefull for someone...
Back to top
View user's profile Send private message
blaise


Posts: 5

PostPosted: Tue Jan 15, 2008 2:32 am    Post subject: Reply with quote

Thanks to all contributors for the script. It works perfectly Very Happy
Back to top
View user's profile Send private message
sunkast


Posts: 5

PostPosted: Tue Feb 19, 2008 6:11 pm    Post subject: Reply with quote

Did the script break again for anyone? Seems like it isn't properly parsing the feed as it used to. I'm only getting one episode listed for each episode that is on the actual feed.
Back to top
View user's profile Send private message
blaise


Posts: 5

PostPosted: Tue Feb 19, 2008 6:52 pm    Post subject: Reply with quote

Still works fine, with the fixes described in this topic.
Back to top
View user's profile Send private message
Telecart


Posts: 9

PostPosted: Tue Feb 19, 2008 6:58 pm    Post subject: Reply with quote

Works fine for me.
Back to top
View user's profile Send private message
sunkast


Posts: 5

PostPosted: Tue Feb 19, 2008 8:30 pm    Post subject: Reply with quote

Henrik_DK's post fixed my issue. Should have read it earlier...

I'll update the zip file I have on my server with these fixes. This way both links will have a working version.
Back to top
View user's profile Send private message
grintoul


Posts: 1

PostPosted: Sun Mar 30, 2008 4:50 pm    Post subject: Thanks, Saxx! Reply with quote

saxx wrote:
I wrote pretty the same thing using ASP.NET 2.0 and C# for myself. If you want the (dirty, but short, only a few lines) code, just message me.

Anyway, I'm running the script on my server and I don't see any reason why I shouldn't share it with you guys (as long as my bandwidth can take it). So, if you don't have your own PHP webspace and want to import your episodes into Google Calendar, use this url (but change the two querystring variables):

http://www.sachsenhofer.com/stuff/myepisodestoical.aspx?uid=YOURUSER&pwdmd5=YOURMD5PWD

The script loads your RSS feed mylist and returns it in ICal format. I've tested it with Google Calender (I don't use any other ICal Application, so I don't know if it works with those).

ps: I'm not logging your users or hashed passwords, so don't worry Very Happy


@saxx Thanks very much for hosting this, it's much appreciated Very Happy Wouldn't have had a clue how to go about hosting it myself!
Back to top
View user's profile Send private message
lazyjunk


Posts: 2

PostPosted: Wed May 07, 2008 8:11 am    Post subject: Reply with quote

did anyone fix the apostrophe issue? it shows up as the html equivalent , instead of '
Back to top
View user's profile Send private message
eliah


Posts: 2

PostPosted: Sat Sep 20, 2008 4:42 am    Post subject: Reply with quote

I would just like to update saying that this seems to be broken in Gcal right now. It keeps giving me an error: "we could not parse the calendar at the url requested", and refusing to add the calendar. Works fine in iCal though.

It would be really nice to get some official iCal feed support.
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 2 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.