Skip to content

Instantly share code, notes, and snippets.

View julien51's full-sized avatar

Julien Genestoux julien51

View GitHub Profile
module SuperParsr
module Atom
def namespaces
"http://www.w3.org/2005/Atom"
# [nil, 'http://www.w3.org/2005/Atom', 'http://purl.org/atom/ns', 'http://purl.org/atom/ns#']
end
module Feed
module SuperParsr
module Atom
def namespaces
'http://www.w3.org/2005/Atom'
#['http://www.w3.org/2005/Atom', 'http://purl.org/atom/ns', 'http://purl.org/atom/ns#']
end
module Feed
Linux 2.6.24-23-xen (SuperfeedrDatabase) 08/14/09 _x86_64_
avg-cpu: %user %nice %system %iowait %steal %idle
0.55 0.00 0.08 0.99 1.16 97.21
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda1 27.05 1.82 1395.12 11298066 8644104768
sda2 0.00 0.00 0.00 4176 10648
avg-cpu: %user %nice %system %iowait %steal %idle
task :subscribe_superfeedr do
feeds = Feed.find(:all, :select=>["distinct(feedurl)"], :limit=>2000, :conditions=>{:superfeedr=>false})
Superfeedr.connect(Tfweb.conf[:superfeedr_jid], Tfweb.conf[:superfeedr_password]) do
puts "Connected to superfeedr"
if feeds.count == 0
EM.stop
end
require 'test/helper'
describe EventMachine::HttpRequest do
def failed
EventMachine.stop
fail
end
it "should be able to fetch http://www.wral.com/news/rss/4/" do
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>TechCrunch</title>
<atom:link href="http://feedproxy.google.com/TechCrunch" rel="self" type="application/rss+xml" />
<link>http://www.techcrunch.com</link>
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>TechCrunch</title>
<atom:link href="http://feedproxy.google.com/TechCrunch" rel="self" type="application/rss+xml" />
<link>http://www.techcrunch.com</link>
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>TechCrunch</title>
<atom:link href="http://feedproxy.google.com/TechCrunch" rel="self" type="application/rss+xml" />
<link>http://www.techcrunch.com</link>
require 'rubygems'
require 'sinatra'
require 'atom'
require 'xmlrpc/client'
require 'uri'
# Make sure our template can use <%=h
helpers do
include Rack::Utils
alias_method :h, :escape_html
pluto:superfeedr_to_blog.gae julien$ dev_appserver.rb .
=> Booting DevAppServer
=> Press Ctrl-C to shutdown server
2009-09-23 22:25:42.839 java[25315:a0b] [Java CocoaComponent compatibility mode]: Enabled
2009-09-23 22:25:42.841 java[25315:a0b] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000
The server is running at http://localhost:8080/
Sep 24, 2009 5:27:15 AM com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /index.html
#<URI::HTTP:0x2c URL:http://superfeedrdemo:[email protected]/xmlrpc.php>
Sep 24, 2009 5:27:16 AM com.google.appengine.tools.development.ApiProxyLocalImpl log