Okay, I finally got around to it....
Yes, it's cheap and hackish, but it works. It runs from a cronjob
every 10 minutes and does a cheap parse/convert of google's Atom into
RSS and saves it to /tmp for the server to pick up.
It does need lynx-ssl to grab the feed, which is why I won't make it
into a module.. I don't mind snarfing stuff with lynx in a script, but
it's too ugly of a method for a plugin, but, then so is tossing tons of
ssl code into slimserver.
Code:
--------------------
#!/usr/bin/perl
use XML::Feed;
use XML::Feed::Atom;
$user = "yourname here";
$pass = "password";
$url = "lynx -dump -auth=$user:$pass " .
"https://mail.google.com/gmail/feed/atom";
$atom = `$url`;
my $feed = XML::Feed->parse(\$atom);
open TMP, ">/tmp/gmail.tmp";
print TMP '<?xml version="1.0" encoding="iso-8859-1" ?>',
'<rss version="0.91">',
'<channel><title>Gmail Inbox</title>',
'<description>gmail inbox</description>';
for $entry ( $feed->entries )
{
$summary = $entry->summary();
print TMP "<item><title>", $entry->author, ": ", $entry->title, "</title>",
"<description>", $summary->body, "</description>",
"</item>\n";
}
print TMP "</channel></rss>";
rename ("/tmp/gmail.tmp", "/tmp/gmail");
--------------------
Even if hackish, I now can see my mail scroll by.
--
snarlydwarf
------------------------------------------------------------------------
snarlydwarf's Profile: http://forums.slimdevices.com/member.php?userid=1179
View this thread: http://forums.slimdevices.com/showthread.php?t=20163
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins