<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: feed code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 27 Jul 2008 01:11:26 GMT</pubDate>
    <description>DZone Snippets: feed code</description>
    <item>
      <title>Retrieve your Gmail messages as an XML feed</title>
      <link>http://snippets.dzone.com/posts/show/5097</link>
      <description>This Ruby example shows how to retrieve your most recent email as an atom XML feed from the Google Apps website.  &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;require 'rubygems'&lt;br /&gt;require 'httpclient'&lt;br /&gt;&lt;br /&gt;url = "https://mail.google.com/a/yourwebsite.com/feed/atom"&lt;br /&gt;client = HTTPClient.new&lt;br /&gt;client.debug_dev = STDOUT if $DEBUG&lt;br /&gt;client.set_auth(url, 'yourname@yourwebsite.com', 'yourpassword')&lt;br /&gt;resp = client.get(url)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Note: You might require to gem install httpclient.</description>
      <pubDate>Sun, 03 Feb 2008 16:29:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5097</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
    <item>
      <title>RSS Feed for DZone Snippets Comments</title>
      <link>http://snippets.dzone.com/posts/show/5031</link>
      <description>&lt;a href="http://feed43.com/8055673348816228.xml"&gt;http://feed43.com/8055673348816228.xml&lt;/a&gt;</description>
      <pubDate>Wed, 23 Jan 2008 14:23:09 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5031</guid>
      <author>timmorgan (Tim Morgan)</author>
    </item>
    <item>
      <title>Broadcasting DZONE Shares</title>
      <link>http://snippets.dzone.com/posts/show/3803</link>
      <description>// This snippet will allow you to show your DZONE shares&lt;br /&gt;// on your web page.   Visit your shares page, click on the "feed" link&lt;br /&gt;// to get the URL of your personal shares feed then paste it in the first line&lt;br /&gt;// in the script.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var sharedURL='';  // Place your url between the quotes.&lt;br /&gt;&lt;br /&gt;function getFeed(url, callback) {&lt;br /&gt;   var newScript = document.createElement('script');&lt;br /&gt;       newScript.type = 'text/javascript';&lt;br /&gt;       newScript.src = 'http://pipes.yahoo.com/pipes/9oyONQzA2xGOkM4FqGIyXQ/run?&amp;_render=JSON&amp;_callback='+callback+'&amp;feed=' + sharedURL;&lt;br /&gt;   document.getElementsByTagName("head")[0].appendChild(newScript);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function dzone(feed) {&lt;br /&gt;   var tmp='';&lt;br /&gt;   for (var i=0; i&lt;feed.value.items.length; i++) {&lt;br /&gt;      tmp+='&lt;a href="'+feed.value.items[i].link+'" rel="nofollow"&gt;';&lt;br /&gt;      tmp+=feed.value.items[i].title+'&lt;/a&gt;&lt;br&gt;';&lt;br /&gt;   }&lt;br /&gt;   document.getElementById('dzoneLinks').innerHTML=tmp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;getFeed(sharedURL, 'dzone');&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;// Paste that code at the end of your page.   In your HTML place the following two divisions&lt;br /&gt;// where you would like your feed to appear.  (feel free to style the divisions however you wish)&lt;br /&gt;// you can add to/subtract from the outer division but the inner division will always be overwritten&lt;br /&gt;// with your shares.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;div id='dzoneLayer'&gt;&lt;br /&gt;My DZONE Recommendations&lt;br /&gt;   &lt;div id='dzoneLinks'&gt;&lt;br /&gt;   &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Thu, 12 Apr 2007 05:49:24 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3803</guid>
      <author>pcx99 (Patrick)</author>
    </item>
    <item>
      <title>Screen scape heise.de newsticker (german)</title>
      <link>http://snippets.dzone.com/posts/show/886</link>
      <description>&lt;code&gt;&lt;br /&gt;#!/usr/bin/env python&lt;br /&gt;# -*- encoding: latin1 -*-&lt;br /&gt;&lt;br /&gt;import BeautifulSoup&lt;br /&gt;from PyRSS2Gen import RSSItem, Guid&lt;br /&gt;import ScrapeNFeed&lt;br /&gt;import urllib2&lt;br /&gt;import re&lt;br /&gt;&lt;br /&gt;debug = 0&lt;br /&gt;&lt;br /&gt;def fetch(url):&lt;br /&gt;    response = urllib2.urlopen(urllib2.Request(url))&lt;br /&gt;    return response.read(),response.info()&lt;br /&gt;&lt;br /&gt;class HeiFeed(ScrapeNFeed.ScrapedFeed):    &lt;br /&gt;    def HTML2RSS(self, headers, body):&lt;br /&gt;        items = []&lt;br /&gt;        soup = BeautifulSoup.BeautifulSoup(body)&lt;br /&gt;        for item in soup('a', {'href' : re.compile('^meldung.*')}):&lt;br /&gt;            link = 'http://www.heise.de/newsticker/' + item['href']&lt;br /&gt;            if not self.hasSeen(link):&lt;br /&gt;                title = item.contents[0].strip()&lt;br /&gt;                if debug:&lt;br /&gt;                    print "title: " + title&lt;br /&gt;                    print "link : " + link&lt;br /&gt;                response, headers = fetch(link)&lt;br /&gt;                s = BeautifulSoup.BeautifulSoup(response)&lt;br /&gt;                desc = s.fetch('div',{'class':'meldung_wrapper'})[0].prettify()&lt;br /&gt;                items.append(RSSItem(title=title, description=desc, link=link))&lt;br /&gt;            self.addRSSItems(items)&lt;br /&gt;&lt;br /&gt;HeiFeed.load("heise.de newsticker", 'http://www.heise.de/newsticker/',&lt;br /&gt;             "heise.de newsticker", 'heise_rss.xml', 'heise_rss.pickle',&lt;br /&gt;             managingEditor = 'tsch')&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 13 Nov 2005 03:04:25 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/886</guid>
      <author>tsch ()</author>
    </item>
  </channel>
</rss>
