Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Freed</title>
<!-- Javascript -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="http://0.0.0.0:3000/socket.io/socket.io.js"></script>
</head>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Freed</title>
<!-- Javascript -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="http://0.0.0.0:3000/socket.io/socket.io.js"></script>
</head>
<?xml version="1.0"?>
<?xml-stylesheet href="/css/rss20.xsl" type="text/xsl"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:nyt="http://www.nytimes.com/namespaces/rss/2.0" version="2.0" xmlns:pheedo="http://www.pheedo.com/namespace/pheedo">
<channel>
<title>NYT &gt; Home Page</title>
<link>http://www.nytimes.com/pages/index.html?partner=rss&amp;emc=rss</link>
<description/>
<language>en-us</language>
<copyright>Copyright 2010 The New York Times Company</copyright>
<lastBuildDate>Mon, 27 Sep 2010 16:22:08 GMT </lastBuildDate>
<entry xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
<id>http://digg.com/news/business/making_philanthropy_cool_thinking_about_facebook_s_100_million_donation_to_newark</id>
<published>2010-09-25T09:51:32+02:00</published>
<title>"Making Philanthropy Cool": Thinking About Facebook's $100 Million Donation to Newark</title>
<summary type="html">Should all gifts be treated as good, no matter their intent, their reason or their origin? Maybe, if the gifts are $100 million to fix public schools.
That&#x2019;s certainly the reaction to Mark Zuckerberg&#x2019;s announcement, set for today on Oprah, that he&#x2019;ll be making an enormous donation to the Newark public school system. The timing is suspicious given the impending release of that damning film about Zuckerberg, everyone acknowledges. But then they point out that it shouldn&#x2019;t matter.
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:digg="http://digg.com/docs/diggrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>
digg.com: Stories
</title>
<language>
en-us
</language>
<description>
<rss version="2.0">
<channel>
<title>DEVZONE :: HIGHLOAD DEV</title>
<link>http://devz.tk/rss/</link>
<description>DEVZONE RSS FEED</description>
<!-- THNG TO ADD -->
<!-- PubSubHubbub Discovery -->
<link rel="hub" href="http://devz.superfeedr.com/" xmlns="http://www.w3.org/2005/Atom" />
require 'rubygems'
require 'sinatra'
require 'rack/facebook'
set :port, 3000
use Rack::Facebook, :app_name => "PubSubHubbub Subscriber", :application_secret => "hah", :api_key => "huh"
get '/' do
"Hello!"
require 'rubygems'
require 'em-http'
require 'time'
#"{\"modified\":1282228860,\"etag\":\"NaTRM8p2KwPYAS3C82mbgEwF2QA\",\"period\":43200,\"entries_count\":0,\"url\":\"http://shannoncarlson.tumblr.com/rss\",\"last_maintenance_at\":1282229793}"
EventMachine.run {
http = EventMachine::HttpRequest.new('http://shannoncarlson.tumblr.com/rss').get :timeout => 10, :head => {'If-None-Match' => "NaTRM8p2KwPYAS3C82mbgEwF2QA", 'If-Modified-Since' => Time.at(1282228860).httpdate}, :redirects => 5
http.callback {
<status feed="http://domain.tld/feed.xml" xmlns="http://superfeedr.com/xmpp-pubsub-ext">
<http code="200">9718 bytes fetched in 1.462708s : 2 new entries.</http>
<next_fetch>2010-05-10T11:19:38-07:00</next_fetch>
<period>900</period>
<last_fetch>2010-05-10T11:19:38-07:00</last_fetch>
<last_parse>2010-05-10T11:17:19-07:00</last_parse>
<last_maintenance_at>2010-05-10T09:45:08-07:00</last_maintenance_at>
<entries_count_since_last_maintenance>5</entries_count_since_last_maintenance>
<tilte>Lorem Ipsum</tilte>
</status>
class File
def self.canonical(_path)
_path.split("/").inject([]) { |p,n|
case n
when "."
p
when ".."
p.pop
p
else