panpainter-featherdust 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +5 -4
- data/Rakefile +1 -0
- data/featherdust.gemspec +2 -2
- data/lib/featherdust.rb +8 -4
- metadata +2 -2
data/README.txt
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
= Featherdust
|
2
2
|
|
3
|
-
* http://rubyforge.org/projects/uwruby
|
4
|
-
* http://uwruby.rubyforge.org/featherdust/
|
5
3
|
* http://featherdust.panpainter.com
|
6
4
|
* http://github.com/panpainter/featherdust/tree/master
|
7
5
|
* http://panpainter.lighthouseapp.com/projects/21671/home
|
@@ -17,7 +15,7 @@ If you have questions (or suggestions), please feel free to shoot them off to mi
|
|
17
15
|
== FEATURES/PROBLEMS:
|
18
16
|
|
19
17
|
* Takes in a username and an integer and returns a list of Twitter updates.
|
20
|
-
*
|
18
|
+
* Has several display options: plain text, html, and relative and static time outputs
|
21
19
|
|
22
20
|
== SYNOPSIS:
|
23
21
|
|
@@ -31,11 +29,14 @@ If you have questions (or suggestions), please feel free to shoot them off to mi
|
|
31
29
|
== REQUIREMENTS:
|
32
30
|
|
33
31
|
* nokogiri
|
32
|
+
* duration
|
34
33
|
* net/http
|
34
|
+
* time
|
35
35
|
|
36
36
|
== INSTALL:
|
37
37
|
|
38
|
-
* gem
|
38
|
+
* gem sources -a http://gems.github.com (only ever needs to be run once)
|
39
|
+
* gem install panpainter-featherdust
|
39
40
|
|
40
41
|
== LICENSE:
|
41
42
|
|
data/Rakefile
CHANGED
data/featherdust.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "featherdust"
|
3
|
-
s.version = "0.0.
|
4
|
-
s.date = "
|
3
|
+
s.version = "0.0.4"
|
4
|
+
s.date = "2009-01-05"
|
5
5
|
s.summary = "Featherdust is a simple Twitter gem that grabs and parses data via the Twitter API."
|
6
6
|
s.email = "mike@panpainter.com"
|
7
7
|
s.homepage = "http://github.com/panpainter/featherdust"
|
data/lib/featherdust.rb
CHANGED
@@ -4,6 +4,7 @@ require 'rubygems'
|
|
4
4
|
require 'nokogiri'
|
5
5
|
require 'net/http'
|
6
6
|
require 'time'
|
7
|
+
require 'duration'
|
7
8
|
|
8
9
|
class Featherdust
|
9
10
|
VERSION = '0.0.3'
|
@@ -16,6 +17,7 @@ class Featherdust
|
|
16
17
|
@username = a
|
17
18
|
elsif a.class == Hash
|
18
19
|
@plain_text = a[:display] if a[:display] = "plain"
|
20
|
+
@static_time = a[:time] if a[:time] = "static"
|
19
21
|
elsif a.class == Fixnum
|
20
22
|
@num_posts = a
|
21
23
|
else
|
@@ -81,10 +83,12 @@ class Featherdust
|
|
81
83
|
end
|
82
84
|
|
83
85
|
def pretty_time(date)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
86
|
+
unless @static_time
|
87
|
+
parsed_date = Time.parse(date)
|
88
|
+
pretty_date += human_time.strftime("%A, %b %d at %I:%M %p")
|
89
|
+
else
|
90
|
+
parsed_date = Date.parse(date)
|
91
|
+
pretty_date = Duration.new(Time.now - parsed_date)
|
88
92
|
end
|
89
93
|
|
90
94
|
def urlize(string)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panpainter-featherdust
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Tierney
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-01-05 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|