ubermajestix-lightning 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.txt +36 -0
- data/Rakefile +31 -0
- data/bin/lightning +55 -0
- data/bin/url_puller +60 -0
- data/lib/lightning.rb +56 -0
- data/lib/lightning/parser.rb +31 -0
- data/lib/lightning/post.rb +22 -0
- data/lightning.gemspec +35 -0
- data/spec/lightning_post_spec.rb +22 -0
- data/spec/parsing_a_feed.rb +19 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/test_feed.xml +335 -0
- metadata +79 -0
data/History.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
ϞLIGHTNINGϞ
|
2
|
+
A fast rss feed parser.
|
3
|
+
|
4
|
+
When you just want content now, boom, you got it.
|
5
|
+
|
6
|
+
===Installation===
|
7
|
+
You need lib-xml. It is 300 times faster than REXML. Here's how you install:
|
8
|
+
|
9
|
+
TODO install instructions for libxml
|
10
|
+
|
11
|
+
===Getting Content===
|
12
|
+
|
13
|
+
Let's get an entire feed.
|
14
|
+
|
15
|
+
posts = Lightning::Parser.parse(:feed=>"http://awesomerails.wordpress.com/feed")
|
16
|
+
|
17
|
+
returns all posts in feed for awesomerails.wordpress.com
|
18
|
+
returns an array Lighting::Post objects that have the post title, link, body, and published_on date
|
19
|
+
|
20
|
+
Let's only get the last five posts.
|
21
|
+
|
22
|
+
posts = Lightning::Parser.parse(:feed=>"http://awesomerails.wordpress.com/feed", :posts=>5)
|
23
|
+
|
24
|
+
returns an array of the last 5 posts as Lightning::Post objects
|
25
|
+
|
26
|
+
|
27
|
+
===Some other useful things===
|
28
|
+
|
29
|
+
url_puller executable which will pull all the urls off a given page.
|
30
|
+
|
31
|
+
$> url_puller http://awesomerails.wordpress.com/2008/08/28/google-public-transit-on-iphone/
|
32
|
+
|
33
|
+
will return you a list of all uniqure urls on the page
|
34
|
+
|
35
|
+
pass --base option to get only the unique base urls ( the base url for: http://awesomerails.wordpress.com/2008/08/28/google-public-transit-on-iphone/ is: awesomerails.wordpress.com)
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Look in the tasks/setup.rb file for the various options that can be
|
2
|
+
# configured in this Rakefile. The .rake files in the tasks directory
|
3
|
+
# are where the options are used.
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'bones'
|
7
|
+
Bones.setup
|
8
|
+
rescue LoadError
|
9
|
+
begin
|
10
|
+
load 'tasks/setup.rb'
|
11
|
+
rescue LoadError
|
12
|
+
raise RuntimeError, '### please install the "bones" gem ###'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
ensure_in_path 'lib'
|
17
|
+
require 'lightning'
|
18
|
+
|
19
|
+
task :default => 'spec:run'
|
20
|
+
|
21
|
+
PROJ.name = 'lightning'
|
22
|
+
PROJ.authors = 'Tyler Montgomery'
|
23
|
+
PROJ.email = 'tyler.a.montgomery@gmail.com'
|
24
|
+
PROJ.url = 'http://github.com/ubermajestix/lightning'
|
25
|
+
PROJ.version = Lightning::VERSION
|
26
|
+
PROJ.rubyforge.name = "lightning"
|
27
|
+
PROJ.summary = "boom"
|
28
|
+
PROJ.spec.opts << '--color'
|
29
|
+
PROJ.ignore_file = '.gitignore'
|
30
|
+
|
31
|
+
# EOF
|
data/bin/lightning
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.expand_path(
|
4
|
+
File.join(File.dirname(__FILE__), %w[.. lib lightning]))
|
5
|
+
|
6
|
+
|
7
|
+
require 'rubygems'
|
8
|
+
require 'open-uri'
|
9
|
+
require 'fastercsv'
|
10
|
+
|
11
|
+
|
12
|
+
begin
|
13
|
+
gem "main", ">= 2.8.2" # 2.8.2 has a bugfix for the default block for -1 arity arguments
|
14
|
+
require "main"
|
15
|
+
rescue Gem::LoadError
|
16
|
+
STDERR.puts "need the main gem to run lightning. sudo gem install main"
|
17
|
+
end
|
18
|
+
|
19
|
+
Main do
|
20
|
+
|
21
|
+
description <<-EOS
|
22
|
+
Pulls down posts from an rss feed
|
23
|
+
EOS
|
24
|
+
|
25
|
+
examples <<-EOS
|
26
|
+
You can get all posts for a feed like this:
|
27
|
+
lightning http://awesomerails.wordpress.com/feed
|
28
|
+
EOS
|
29
|
+
|
30
|
+
option "dump_csv" do
|
31
|
+
description "dumps posts for a csv file"
|
32
|
+
attribute
|
33
|
+
end
|
34
|
+
|
35
|
+
run do
|
36
|
+
posts = Lightning::Parser.parse(:feed=>ARGV[0])
|
37
|
+
if dump_csv
|
38
|
+
write_csv(posts)
|
39
|
+
else
|
40
|
+
posts.each { |post| puts "#{post.published_on}, #{post.title}, #{post.link}, #{post.description}" }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def write_csv(posts)
|
45
|
+
# TODO return post.published on as DateTime
|
46
|
+
# posts.sort!{|a,b| a.published_on <=> b.published_on}
|
47
|
+
FCSV.open("rss_feed_posts.csv", "wb") do |csv|
|
48
|
+
csv << %w"published_on title link description"
|
49
|
+
posts.each do |post|
|
50
|
+
csv << [post.published_on, post.title, post.link, post.description]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/bin/url_puller
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.expand_path(
|
4
|
+
File.join(File.dirname(__FILE__), %w[.. lib lightning]))
|
5
|
+
|
6
|
+
require 'rubygems'
|
7
|
+
require 'open-uri'
|
8
|
+
require 'fastercsv'
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
begin
|
15
|
+
gem "main", ">= 2.8.2" # 2.8.2 has a bugfix for the default block for -1 arity arguments
|
16
|
+
require "main"
|
17
|
+
rescue Gem::LoadError
|
18
|
+
STDERR.puts "need the main gem to run url_puller. sudo gem install main"
|
19
|
+
end
|
20
|
+
|
21
|
+
Main do
|
22
|
+
|
23
|
+
description <<-EOS
|
24
|
+
Pull a list of all urls from a given url or file
|
25
|
+
EOS
|
26
|
+
|
27
|
+
examples <<-EOS
|
28
|
+
You can get all urls for a page like this:
|
29
|
+
url_puller http://awesomerails.wordpress.com
|
30
|
+
Or if you want to just pull the baseurl (somedomian.com) pass --base
|
31
|
+
url_puller --base http://awesomerails.wordpress.com
|
32
|
+
EOS
|
33
|
+
|
34
|
+
option "base" do
|
35
|
+
description "will only retrive unique base urls"
|
36
|
+
attribute
|
37
|
+
end
|
38
|
+
|
39
|
+
run do
|
40
|
+
puts "pulling base urls for: #{ARGV[0]}" if base
|
41
|
+
puts "pulling all urls for: #{ARGV[0]}" unless base
|
42
|
+
|
43
|
+
doc = ""
|
44
|
+
open(ARGV[0]){|f|
|
45
|
+
f.each_line {|line| doc << line}
|
46
|
+
}
|
47
|
+
urls = []
|
48
|
+
doc.split.each{|a| a=~ %r(http://([^/"<:]+)/); urls << $1} if base
|
49
|
+
doc.split.each{|a| a=~ %r(http://([^"<:]+)/); urls << $1} unless base
|
50
|
+
urls = urls.compact.uniq
|
51
|
+
if ARGV[0] == "dump_csv"
|
52
|
+
FCSV.open("/urls.csv", 'w') do |csv|
|
53
|
+
urls.each { |u| csv << u }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
puts "found #{urls.length} unique urls"
|
57
|
+
urls.each { |u| puts u }
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
data/lib/lightning.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'fastercsv'
|
3
|
+
require 'yaml'
|
4
|
+
require 'xml'
|
5
|
+
require 'libxml'
|
6
|
+
require 'time'
|
7
|
+
module Lightning
|
8
|
+
|
9
|
+
# :stopdoc:
|
10
|
+
VERSION = '1.0.0'
|
11
|
+
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
12
|
+
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
13
|
+
# :startdoc:
|
14
|
+
|
15
|
+
class Error < StandardError; end
|
16
|
+
|
17
|
+
# Returns the version string for the library.
|
18
|
+
#
|
19
|
+
def self.version
|
20
|
+
VERSION
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns the library path for the module. If any arguments are given,
|
24
|
+
# they will be joined to the end of the libray path using
|
25
|
+
# <tt>File.join</tt>.
|
26
|
+
#
|
27
|
+
def self.libpath( *args )
|
28
|
+
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns the lpath for the module. If any arguments are given,
|
32
|
+
# they will be joined to the end of the path using
|
33
|
+
# <tt>File.join</tt>.
|
34
|
+
#
|
35
|
+
def self.path( *args )
|
36
|
+
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Utility method used to require all files ending in .rb that lie in the
|
40
|
+
# directory below this file that has the same name as the filename passed
|
41
|
+
# in. Optionally, a specific _directory_ name can be passed in such that
|
42
|
+
# the _filename_ does not have to be equivalent to the directory.
|
43
|
+
#
|
44
|
+
def self.require_all_libs_relative_to( fname, dir = nil )
|
45
|
+
dir ||= ::File.basename(fname, '.*')
|
46
|
+
search_me = ::File.expand_path(
|
47
|
+
::File.join(::File.dirname(fname), dir, '**', '*.rb'))
|
48
|
+
|
49
|
+
Dir.glob(search_me).sort.each {|rb| require rb}
|
50
|
+
end
|
51
|
+
|
52
|
+
end # module Lightning
|
53
|
+
|
54
|
+
Lightning.require_all_libs_relative_to(__FILE__)
|
55
|
+
|
56
|
+
# EOF
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Lightning
|
2
|
+
class Parser
|
3
|
+
class << self
|
4
|
+
# pass :feed for the feed url or file location - required
|
5
|
+
# pass :posts for the number of posts to return - optional
|
6
|
+
# returns an array of Lightning::Post objects
|
7
|
+
def parse(opts={})
|
8
|
+
raise "need to provide a feed url or file for this to work" unless opts[:feed]
|
9
|
+
posts = []
|
10
|
+
feed = opts[:feed]
|
11
|
+
unless File.exists?(feed)
|
12
|
+
feed = "http://" + feed unless feed.include?("http://")
|
13
|
+
end
|
14
|
+
# TODO [tm] handle exceptions and errors
|
15
|
+
# handle if file is not found - don't try to add http - remove this piece probably
|
16
|
+
doc = XML::Parser.file(feed).parse
|
17
|
+
items = doc.find("//*[local-name()='item']").to_a
|
18
|
+
items = items[0, (opts[:posts] > items.length ? items.length : opts[:posts])] if opts[:posts]
|
19
|
+
items.each do |item|
|
20
|
+
desc = item.find('description').first.content
|
21
|
+
title = item.find('title').first.content
|
22
|
+
link = item.find('link').first.content
|
23
|
+
pub_date = Time.parse(item.find('pubDate').first.content)
|
24
|
+
thumbnail = item.find('media:thumbnail').first.attributes[:url] if item.find('media:thumbnail').first
|
25
|
+
posts << Lightning::Post.new(:title=>title, :pub_date=>pub_date, :link => link, :description => desc, :feed=>feed, :thumbnail=>thumbnail )
|
26
|
+
end
|
27
|
+
return posts
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Lightning
|
2
|
+
class Post
|
3
|
+
attr_accessor :feed
|
4
|
+
attr_accessor :title
|
5
|
+
attr_accessor :link
|
6
|
+
attr_accessor :description
|
7
|
+
attr_accessor :pub_date
|
8
|
+
attr_accessor :thumbnail
|
9
|
+
|
10
|
+
|
11
|
+
def initialize(opts={})
|
12
|
+
self.title = opts[:title]
|
13
|
+
self.link = opts[:link]
|
14
|
+
self.description = opts[:description]
|
15
|
+
self.pub_date = opts[:pub_date]
|
16
|
+
self.feed = opts[:feed]
|
17
|
+
self.thumbnail = opts[:thumbnail]
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
data/lightning.gemspec
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{lightning}
|
5
|
+
s.version = "1.0.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Tyler Montgomery"]
|
9
|
+
s.date = %q{2009-03-04}
|
10
|
+
s.description = %q{}
|
11
|
+
s.email = %q{tyler.a.montgomery@gmail.com}
|
12
|
+
s.executables = ["lightning", "url_puller"]
|
13
|
+
s.extra_rdoc_files = ["History.txt", "README.txt", "bin/lightning", "bin/url_puller"]
|
14
|
+
s.files = ["History.txt", "README.txt", "Rakefile", "bin/lightning", "bin/url_puller", "lib/lightning.rb", "lib/lightning/parser.rb", "lib/lightning/post.rb", "lightning.gemspec", "spec/lightning_post_spec.rb", "spec/parsing_a_feed.rb", "spec/spec_helper.rb", "spec/test_feed.xml"]
|
15
|
+
s.has_rdoc = true
|
16
|
+
s.homepage = %q{http://github.com/ubermajestix/lightning}
|
17
|
+
s.rdoc_options = ["--main", "README.txt"]
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
s.rubyforge_project = %q{lightning}
|
20
|
+
s.rubygems_version = %q{1.3.1}
|
21
|
+
s.summary = %q{boom}
|
22
|
+
|
23
|
+
if s.respond_to? :specification_version then
|
24
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
|
+
s.specification_version = 2
|
26
|
+
|
27
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
28
|
+
s.add_development_dependency(%q<bones>, [">= 2.4.0"])
|
29
|
+
else
|
30
|
+
s.add_dependency(%q<bones>, [">= 2.4.0"])
|
31
|
+
end
|
32
|
+
else
|
33
|
+
s.add_dependency(%q<bones>, [">= 2.4.0"])
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[spec_helper])
|
2
|
+
|
3
|
+
describe Lightning::Post do
|
4
|
+
# TODO [tm] spec out Post object
|
5
|
+
it "should have attributes that are accessible" do
|
6
|
+
post = Lightning::Post.new
|
7
|
+
post.title.should be_nil
|
8
|
+
post.title = "blah"
|
9
|
+
post.title.should_not be_nil
|
10
|
+
end
|
11
|
+
|
12
|
+
it "references the feed it was parsed from" do
|
13
|
+
post = Lightning::Parser.parse(:feed=>"#{Dir.pwd}/spec/test_feed.xml", :posts=>1).first
|
14
|
+
post.feed.should == "#{Dir.pwd}/spec/test_feed.xml"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return published_on as Time" do
|
18
|
+
post = Lightning::Parser.parse(:feed=>"#{Dir.pwd}/spec/test_feed.xml", :posts=>1).first
|
19
|
+
post.pub_date.class.should == Time
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[spec_helper])
|
2
|
+
|
3
|
+
describe Lightning::Parser do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@posts = Lightning::Parser.parse(:feed=>"#{Dir.pwd}/spec/test_feed.xml")
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should parse an entire feed into Lighting::Post objects" do
|
10
|
+
@posts.should_not be_nil
|
11
|
+
@posts.first.class.should == Lightning::Post
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should parse part of a feed" do
|
15
|
+
post = Lightning::Parser.parse(:feed=>"#{Dir.pwd}/spec/test_feed.xml", :posts=>1)
|
16
|
+
post.should_not be_nil
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
require File.expand_path(
|
3
|
+
File.join(File.dirname(__FILE__), %w[.. lib lightning]))
|
4
|
+
|
5
|
+
Spec::Runner.configure do |config|
|
6
|
+
# == Mock Framework
|
7
|
+
#
|
8
|
+
# RSpec uses it's own mocking framework by default. If you prefer to
|
9
|
+
# use mocha, flexmock or RR, uncomment the appropriate line:
|
10
|
+
#
|
11
|
+
# config.mock_with :mocha
|
12
|
+
# config.mock_with :flexmock
|
13
|
+
# config.mock_with :rr
|
14
|
+
end
|
15
|
+
|
16
|
+
# EOF
|
data/spec/test_feed.xml
ADDED
@@ -0,0 +1,335 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<rss version="2.0"
|
3
|
+
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
4
|
+
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
|
5
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
6
|
+
xmlns:atom="http://www.w3.org/2005/Atom"
|
7
|
+
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
|
8
|
+
xmlns:media="http://search.yahoo.com/mrss/"
|
9
|
+
>
|
10
|
+
|
11
|
+
<channel>
|
12
|
+
<title>Rails says "RoR!"</title>
|
13
|
+
<atom:link href="http://awesomerails.wordpress.com/feed/" rel="self" type="application/rss+xml" />
|
14
|
+
<link>http://awesomerails.wordpress.com</link>
|
15
|
+
<description>taming the animal...and linux too.</description>
|
16
|
+
<pubDate>Thu, 05 Feb 2009 19:05:28 +0000</pubDate>
|
17
|
+
<generator>http://wordpress.org/?v=MU</generator>
|
18
|
+
<language>en</language>
|
19
|
+
<sy:updatePeriod>hourly</sy:updatePeriod>
|
20
|
+
<sy:updateFrequency>1</sy:updateFrequency>
|
21
|
+
<image>
|
22
|
+
<url>http://www.gravatar.com/blavatar/b5a52ddf0306f683654982960a6aec98?s=96&d=http://s.wordpress.com/i/buttonw-com.png</url>
|
23
|
+
<title>Rails says "RoR!"</title>
|
24
|
+
<link>http://awesomerails.wordpress.com</link>
|
25
|
+
</image>
|
26
|
+
<item>
|
27
|
+
<title>Design By Management = Bad Idea</title>
|
28
|
+
<link>http://awesomerails.wordpress.com/2009/02/05/design-by-management-bad-idea/</link>
|
29
|
+
<comments>http://awesomerails.wordpress.com/2009/02/05/design-by-management-bad-idea/#comments</comments>
|
30
|
+
<pubDate>Thu, 05 Feb 2009 19:05:28 +0000</pubDate>
|
31
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
32
|
+
|
33
|
+
<category><![CDATA[Rails]]></category>
|
34
|
+
|
35
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=174</guid>
|
36
|
+
<description><![CDATA[Management didn’t get to where they are by being good designers. They do not know what looks good and what looks bad. They do know, I hope, how to run a business.
|
37
|
+
You should leave complex things like typesetting, color theory page layout, etc to a designer. Management types should worry about getting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=174&subd=awesomerails&ref=&feed=1" />]]></description>
|
38
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2009/02/05/design-by-management-bad-idea/feed/</wfw:commentRss>
|
39
|
+
|
40
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
41
|
+
<media:title type="html">TylerMontgomery</media:title>
|
42
|
+
</media:content>
|
43
|
+
</item>
|
44
|
+
<item>
|
45
|
+
<title>Don’t leave this page cause I said so dialog</title>
|
46
|
+
<link>http://awesomerails.wordpress.com/2009/01/26/dont-leave-this-page-cause-i-said-so-dialog/</link>
|
47
|
+
<comments>http://awesomerails.wordpress.com/2009/01/26/dont-leave-this-page-cause-i-said-so-dialog/#comments</comments>
|
48
|
+
<pubDate>Mon, 26 Jan 2009 19:14:09 +0000</pubDate>
|
49
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
50
|
+
|
51
|
+
<category><![CDATA[Rails]]></category>
|
52
|
+
|
53
|
+
<category><![CDATA[javascript]]></category>
|
54
|
+
|
55
|
+
<category><![CDATA[confirmation]]></category>
|
56
|
+
|
57
|
+
<category><![CDATA[js confirmation dialog]]></category>
|
58
|
+
|
59
|
+
<category><![CDATA[onbeforeunload]]></category>
|
60
|
+
|
61
|
+
<category><![CDATA[onbeforeunload confirmation]]></category>
|
62
|
+
|
63
|
+
<category><![CDATA[keep user from navigating away]]></category>
|
64
|
+
|
65
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=164</guid>
|
66
|
+
<description><![CDATA[I have a process where I create an object on one screen, and then in the next screen add some information to that object.
|
67
|
+
Problem is, if you navigate away from that second page I have an object that has no important info attached to it.
|
68
|
+
My process is a wizard approach to setting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=164&subd=awesomerails&ref=&feed=1" />]]></description>
|
69
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2009/01/26/dont-leave-this-page-cause-i-said-so-dialog/feed/</wfw:commentRss>
|
70
|
+
|
71
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
72
|
+
<media:title type="html">TylerMontgomery</media:title>
|
73
|
+
</media:content>
|
74
|
+
</item>
|
75
|
+
<item>
|
76
|
+
<title>TwitPlot.com my twitter testing ground</title>
|
77
|
+
<link>http://awesomerails.wordpress.com/2009/01/13/twitplotcom-my-twitter-testing-ground/</link>
|
78
|
+
<comments>http://awesomerails.wordpress.com/2009/01/13/twitplotcom-my-twitter-testing-ground/#comments</comments>
|
79
|
+
<pubDate>Tue, 13 Jan 2009 18:28:09 +0000</pubDate>
|
80
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
81
|
+
|
82
|
+
<category><![CDATA[Rails]]></category>
|
83
|
+
|
84
|
+
<category><![CDATA[twitplot.com twitplot twit plot twitter "twitter api" "twitter gem" "twitter ruby gem" jnunemaker geokit "geokit rails"]]></category>
|
85
|
+
|
86
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/2009/01/13/twitplotcom-my-twitter-testing-ground/</guid>
|
87
|
+
<description><![CDATA[Going to spare you the obligatory 5 paragraph ‘I haven’t posted in months’ intro. So, my new project has been figuring out how to condense this business of twitter into something people can understand and find useful.
|
88
|
+
So I bought http://twitplot.com yesterday, grabbed the pretty well done twitter gem http://github.com/jnunemaker/twitter/ and started playing with the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=157&subd=awesomerails&ref=&feed=1" />]]></description>
|
89
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2009/01/13/twitplotcom-my-twitter-testing-ground/feed/</wfw:commentRss>
|
90
|
+
|
91
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
92
|
+
<media:title type="html">TylerMontgomery</media:title>
|
93
|
+
</media:content>
|
94
|
+
</item>
|
95
|
+
<item>
|
96
|
+
<title>Give Wikipedia some money, you know its helped you win bets.</title>
|
97
|
+
<link>http://awesomerails.wordpress.com/2008/12/22/give-wikipedia-some-money-you-know-its-helped-you-win-bets/</link>
|
98
|
+
<comments>http://awesomerails.wordpress.com/2008/12/22/give-wikipedia-some-money-you-know-its-helped-you-win-bets/#comments</comments>
|
99
|
+
<pubDate>Mon, 22 Dec 2008 18:42:02 +0000</pubDate>
|
100
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
101
|
+
|
102
|
+
<category><![CDATA[Rails]]></category>
|
103
|
+
|
104
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/2008/12/22/give-wikipedia-some-money-you-know-its-helped-you-win-bets/</guid>
|
105
|
+
<description><![CDATA[
|
106
|
+
|
107
|
+
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=156&subd=awesomerails&ref=&feed=1" />]]></description>
|
108
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2008/12/22/give-wikipedia-some-money-you-know-its-helped-you-win-bets/feed/</wfw:commentRss>
|
109
|
+
|
110
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
111
|
+
<media:title type="html">TylerMontgomery</media:title>
|
112
|
+
</media:content>
|
113
|
+
|
114
|
+
<media:content url="http://upload.wikimedia.org/wikipedia/foundation/1/1a/2008_fundraiser_banner_button-en.png" medium="image">
|
115
|
+
<media:title type="html">Wikipedia Affiliate Button</media:title>
|
116
|
+
</media:content>
|
117
|
+
</item>
|
118
|
+
<item>
|
119
|
+
<title>Rentmappr.com ToDo</title>
|
120
|
+
<link>http://awesomerails.wordpress.com/2008/11/24/rentmapprcom-todo/</link>
|
121
|
+
<comments>http://awesomerails.wordpress.com/2008/11/24/rentmapprcom-todo/#comments</comments>
|
122
|
+
<pubDate>Mon, 24 Nov 2008 22:39:59 +0000</pubDate>
|
123
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
124
|
+
|
125
|
+
<category><![CDATA[Rails]]></category>
|
126
|
+
|
127
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=154</guid>
|
128
|
+
<description><![CDATA[
|
129
|
+
ajax change city
|
130
|
+
lightbox welcome (after choose city) (with a don’t show this again - store in session - if they then login check that option and add to db)
|
131
|
+
get rid of saved_houses div if not logged in
|
132
|
+
scroll_to for images/streetview
|
133
|
+
click city name to choose city in addition to ‘pick this city’ link
|
134
|
+
searching not working
|
135
|
+
|
136
|
+
|
137
|
+
       [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=154&subd=awesomerails&ref=&feed=1" />]]></description>
|
138
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2008/11/24/rentmapprcom-todo/feed/</wfw:commentRss>
|
139
|
+
|
140
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
141
|
+
<media:title type="html">TylerMontgomery</media:title>
|
142
|
+
</media:content>
|
143
|
+
</item>
|
144
|
+
<item>
|
145
|
+
<title>How’d this happen?</title>
|
146
|
+
<link>http://awesomerails.wordpress.com/2008/10/29/howd-this-happen/</link>
|
147
|
+
<comments>http://awesomerails.wordpress.com/2008/10/29/howd-this-happen/#comments</comments>
|
148
|
+
<pubDate>Thu, 30 Oct 2008 05:06:57 +0000</pubDate>
|
149
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
150
|
+
|
151
|
+
<category><![CDATA[Rails]]></category>
|
152
|
+
|
153
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=152</guid>
|
154
|
+
<description><![CDATA[So I’m not really sure how I’m at where I’m at and why its so awesome.
|
155
|
+
Big news in my life is that my company had to layoff about 20% of our staff, which meant 4 really talented people from our engineering team got fired on Monday. My boss then writes me in an email that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=152&subd=awesomerails&ref=&feed=1" />]]></description>
|
156
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2008/10/29/howd-this-happen/feed/</wfw:commentRss>
|
157
|
+
|
158
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
159
|
+
<media:title type="html">TylerMontgomery</media:title>
|
160
|
+
</media:content>
|
161
|
+
</item>
|
162
|
+
<item>
|
163
|
+
<title>Fork and Ruby!</title>
|
164
|
+
<link>http://awesomerails.wordpress.com/2008/10/08/fork-and-ruby/</link>
|
165
|
+
<comments>http://awesomerails.wordpress.com/2008/10/08/fork-and-ruby/#comments</comments>
|
166
|
+
<pubDate>Wed, 08 Oct 2008 18:36:19 +0000</pubDate>
|
167
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
168
|
+
|
169
|
+
<category><![CDATA[Ruby]]></category>
|
170
|
+
|
171
|
+
<category><![CDATA[ruby fork]]></category>
|
172
|
+
|
173
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=150</guid>
|
174
|
+
<description><![CDATA[Utilizing a huge amount of resources…i.e. pwnage on a Dell 2950:
|
175
|
+
|
176
|
+
Uploaded with plasq’s Skitch!
|
177
|
+
Check out how all 8 cores are getting used and both network cards are screaming from my 16 ruby processes pulling down a shit-ton of data.
|
178
|
+
|
179
|
+
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=150&subd=awesomerails&ref=&feed=1" />]]></description>
|
180
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2008/10/08/fork-and-ruby/feed/</wfw:commentRss>
|
181
|
+
|
182
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
183
|
+
<media:title type="html">TylerMontgomery</media:title>
|
184
|
+
</media:content>
|
185
|
+
|
186
|
+
<media:content url="http://img.skitch.com/20081008-x2bwe2mbxfurk1stb4ef4k2kan.preview.jpg" medium="image">
|
187
|
+
<media:title type="html">Terminal — ssh — 135×55</media:title>
|
188
|
+
</media:content>
|
189
|
+
</item>
|
190
|
+
<item>
|
191
|
+
<title>Rescuing Exceptions… err… I mean StandardError in Ruby</title>
|
192
|
+
<link>http://awesomerails.wordpress.com/2008/10/07/rescuing-exceptions-err-i-mean-standarderror-in-ruby/</link>
|
193
|
+
<comments>http://awesomerails.wordpress.com/2008/10/07/rescuing-exceptions-err-i-mean-standarderror-in-ruby/#comments</comments>
|
194
|
+
<pubDate>Tue, 07 Oct 2008 17:44:31 +0000</pubDate>
|
195
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
196
|
+
|
197
|
+
<category><![CDATA[Linux]]></category>
|
198
|
+
|
199
|
+
<category><![CDATA[Ruby]]></category>
|
200
|
+
|
201
|
+
<category><![CDATA[rescue]]></category>
|
202
|
+
|
203
|
+
<category><![CDATA[rescue Exception]]></category>
|
204
|
+
|
205
|
+
<category><![CDATA[rescue Exception ruby]]></category>
|
206
|
+
|
207
|
+
<category><![CDATA[rescue standard erorr]]></category>
|
208
|
+
|
209
|
+
<category><![CDATA[rescue StandardError]]></category>
|
210
|
+
|
211
|
+
<category><![CDATA[rescuing exceptions]]></category>
|
212
|
+
|
213
|
+
<category><![CDATA[rescuing exceptions ruby]]></category>
|
214
|
+
|
215
|
+
<category><![CDATA[ruby exceptions]]></category>
|
216
|
+
|
217
|
+
<category><![CDATA[standard error]]></category>
|
218
|
+
|
219
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=145</guid>
|
220
|
+
<description><![CDATA[I’ve heard from people how or how not to rescue things that might break in ruby. And I was confused.
|
221
|
+
Your basic rescue frame of mind is something like this:
|
222
|
+
|
223
|
+
Uploaded with plasq’s Skitch!
|
224
|
+
This won’t give you a very good description of what you rescued so you can rescue specific errors and exceptions like this:
|
225
|
+
|
226
|
+
Uploaded with plasq’s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=145&subd=awesomerails&ref=&feed=1" />]]></description>
|
227
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2008/10/07/rescuing-exceptions-err-i-mean-standarderror-in-ruby/feed/</wfw:commentRss>
|
228
|
+
|
229
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
230
|
+
<media:title type="html">TylerMontgomery</media:title>
|
231
|
+
</media:content>
|
232
|
+
|
233
|
+
<media:content url="http://img.skitch.com/20081007-mimftjjr94de2rfa4a5r5q41rh.preview.jpg" medium="image">
|
234
|
+
<media:title type="html">15306 2014 GitHub</media:title>
|
235
|
+
</media:content>
|
236
|
+
|
237
|
+
<media:content url="http://img.skitch.com/20081007-pqqiwtuc2c2q3dxa661pjn2xay.preview.jpg" medium="image">
|
238
|
+
<media:title type="html">15307 2014 GitHub</media:title>
|
239
|
+
</media:content>
|
240
|
+
|
241
|
+
<media:content url="http://img.skitch.com/20081007-kn5s47gfs57ukb76ci3cp2qba9.preview.jpg" medium="image">
|
242
|
+
<media:title type="html">15307 2014 GitHub</media:title>
|
243
|
+
</media:content>
|
244
|
+
|
245
|
+
<media:content url="http://img.skitch.com/20081007-m6f14u38ygahyiahhjw5k28nw7.preview.jpg" medium="image">
|
246
|
+
<media:title type="html">example.rb</media:title>
|
247
|
+
</media:content>
|
248
|
+
|
249
|
+
<media:content url="http://img.skitch.com/20081007-84xyse54uiccut68pm5tfumdkd.preview.jpg" medium="image">
|
250
|
+
<media:title type="html">Terminal 2014 bash 2014 142�0</media:title>
|
251
|
+
</media:content>
|
252
|
+
|
253
|
+
<media:content url="http://img.skitch.com/20081007-j93t4c77uhyytqe6ghae8773r3.preview.jpg" medium="image">
|
254
|
+
<media:title type="html">The Ruby Programming Language</media:title>
|
255
|
+
</media:content>
|
256
|
+
</item>
|
257
|
+
<item>
|
258
|
+
<title>“Dedicated To: Leaving” hardcore punk I can get into</title>
|
259
|
+
<link>http://awesomerails.wordpress.com/2008/10/03/dedicated-to-leaving-hardcore-punk-i-can-get-into/</link>
|
260
|
+
<comments>http://awesomerails.wordpress.com/2008/10/03/dedicated-to-leaving-hardcore-punk-i-can-get-into/#comments</comments>
|
261
|
+
<pubDate>Fri, 03 Oct 2008 18:35:18 +0000</pubDate>
|
262
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
263
|
+
|
264
|
+
<category><![CDATA[Music]]></category>
|
265
|
+
|
266
|
+
<category><![CDATA[colorado]]></category>
|
267
|
+
|
268
|
+
<category><![CDATA[dedicated to leaving]]></category>
|
269
|
+
|
270
|
+
<category><![CDATA[denver]]></category>
|
271
|
+
|
272
|
+
<category><![CDATA[denver hardcore]]></category>
|
273
|
+
|
274
|
+
<category><![CDATA[denver hardcore punk]]></category>
|
275
|
+
|
276
|
+
<category><![CDATA[denver punk]]></category>
|
277
|
+
|
278
|
+
<category><![CDATA[hardcore]]></category>
|
279
|
+
|
280
|
+
<category><![CDATA[hardcore punk]]></category>
|
281
|
+
|
282
|
+
<category><![CDATA[kyle bayens]]></category>
|
283
|
+
|
284
|
+
<category><![CDATA[punk]]></category>
|
285
|
+
|
286
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=143</guid>
|
287
|
+
<description><![CDATA[My buddy Kyle also went through a rough breakup this past summer with a girl who also left him for a total douche bag. Rough shit to deal with but compounded by the fact that his last band, hardcore metal outfit Murderer, wasn’t booking gigs and couldn’t get their shit together in the studio.
|
288
|
+
Kyle’s life [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=143&subd=awesomerails&ref=&feed=1" />]]></description>
|
289
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2008/10/03/dedicated-to-leaving-hardcore-punk-i-can-get-into/feed/</wfw:commentRss>
|
290
|
+
|
291
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
292
|
+
<media:title type="html">TylerMontgomery</media:title>
|
293
|
+
</media:content>
|
294
|
+
</item>
|
295
|
+
<item>
|
296
|
+
<title>Google Public Transit on iPhone</title>
|
297
|
+
<link>http://awesomerails.wordpress.com/2008/08/28/google-public-transit-on-iphone/</link>
|
298
|
+
<comments>http://awesomerails.wordpress.com/2008/08/28/google-public-transit-on-iphone/#comments</comments>
|
299
|
+
<pubDate>Thu, 28 Aug 2008 21:44:45 +0000</pubDate>
|
300
|
+
<dc:creator>TylerMontgomery</dc:creator>
|
301
|
+
|
302
|
+
<category><![CDATA[Uncategorized]]></category>
|
303
|
+
|
304
|
+
<category><![CDATA[google]]></category>
|
305
|
+
|
306
|
+
<category><![CDATA[google maps]]></category>
|
307
|
+
|
308
|
+
<category><![CDATA[google public transit]]></category>
|
309
|
+
|
310
|
+
<category><![CDATA[google public transit on iphone]]></category>
|
311
|
+
|
312
|
+
<category><![CDATA[iphone]]></category>
|
313
|
+
|
314
|
+
<category><![CDATA[iPhone google map public transit]]></category>
|
315
|
+
|
316
|
+
<category><![CDATA[iphone google maps]]></category>
|
317
|
+
|
318
|
+
<category><![CDATA[iphone public transit]]></category>
|
319
|
+
|
320
|
+
<category><![CDATA[public transit]]></category>
|
321
|
+
|
322
|
+
<category><![CDATA[public transportation]]></category>
|
323
|
+
|
324
|
+
<guid isPermaLink="false">http://awesomerails.wordpress.com/?p=140</guid>
|
325
|
+
<description><![CDATA[So there’s not yet an option to take public transit on the iPhone’s google maps interface. What’s more, if you try to go to maps.google.com with mobile safari, it will kick you back into the native iPhone app. Damn… no public transit routing.
|
326
|
+
But wait!!! If you direct mobile safari to google.com/transit, you will be able [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=awesomerails.wordpress.com&blog=1478867&post=140&subd=awesomerails&ref=&feed=1" />]]></description>
|
327
|
+
<wfw:commentRss>http://awesomerails.wordpress.com/2008/08/28/google-public-transit-on-iphone/feed/</wfw:commentRss>
|
328
|
+
|
329
|
+
<media:content url="http://www.gravatar.com/avatar/3c15293901ba4fbba6736c86b54a81b7?s=96&d=identicon" medium="image">
|
330
|
+
<media:title type="html">TylerMontgomery</media:title>
|
331
|
+
</media:content>
|
332
|
+
</item>
|
333
|
+
</channel>
|
334
|
+
|
335
|
+
</rss>
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ubermajestix-lightning
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tyler Montgomery
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-03-04 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: bones
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.4.0
|
24
|
+
version:
|
25
|
+
description: ""
|
26
|
+
email: tyler.a.montgomery@gmail.com
|
27
|
+
executables:
|
28
|
+
- lightning
|
29
|
+
- url_puller
|
30
|
+
extensions: []
|
31
|
+
|
32
|
+
extra_rdoc_files:
|
33
|
+
- History.txt
|
34
|
+
- README.txt
|
35
|
+
- bin/lightning
|
36
|
+
- bin/url_puller
|
37
|
+
files:
|
38
|
+
- History.txt
|
39
|
+
- README.txt
|
40
|
+
- Rakefile
|
41
|
+
- bin/lightning
|
42
|
+
- bin/url_puller
|
43
|
+
- lib/lightning.rb
|
44
|
+
- lib/lightning/parser.rb
|
45
|
+
- lib/lightning/post.rb
|
46
|
+
- lightning.gemspec
|
47
|
+
- spec/lightning_post_spec.rb
|
48
|
+
- spec/parsing_a_feed.rb
|
49
|
+
- spec/spec_helper.rb
|
50
|
+
- spec/test_feed.xml
|
51
|
+
has_rdoc: true
|
52
|
+
homepage: http://github.com/ubermajestix/lightning
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options:
|
55
|
+
- --main
|
56
|
+
- README.txt
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
requirements: []
|
72
|
+
|
73
|
+
rubyforge_project: lightning
|
74
|
+
rubygems_version: 1.2.0
|
75
|
+
signing_key:
|
76
|
+
specification_version: 2
|
77
|
+
summary: boom
|
78
|
+
test_files: []
|
79
|
+
|