statement 1.8.3 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/statement/feed.rb +2 -0
- data/lib/statement/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: caf83aca4541f8bdfef2f9256fd44b54b26b8d08
|
|
4
|
+
data.tar.gz: d5fe5928f56b30f0d158ad4d6913c2edad187df6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68f37cf991dbef6bad0e3876172c536d2e4b2bf93ae1878151ba88717338b2321ceb062a0e6899ae1a8e82fa9f129f4e54a995b04a21957fd5444b82b44eda91
|
|
7
|
+
data.tar.gz: 84ebb02522231bcef565e232aeca3d97e1753e75003bfbfbd19647f3a9ccf038f0f53f92ce318189fabffb3b7075ff158d5d21bab50a58648293394afad931ee
|
data/README.md
CHANGED
|
@@ -54,6 +54,8 @@ puts results.first
|
|
|
54
54
|
{:source=>"http://blumenauer.house.gov/index.php?option=com_bca-rss-syndicator&feed_id=1", :url=>"http://blumenauer.house.gov/index.php?option=com_content&view=article&id=2203:blumenauer-qwe-need-a-national-system-that-speaks-to-the-transportation-challenges-of-todayq&catid=66:2013-press-releases", :title=>"Blumenauer: "We need a national system that speaks to the transportation challenges of ...", :date=>#<Date: 2013-04-24 ((2456407j,0s,0n),+0s,2299161j)>, :domain=>"blumenauer.house.gov"}
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
Statement will try to parse a date if an RSS feed contains a `PubDate` element; if not it will return `nil`.
|
|
58
|
+
|
|
57
59
|
If you have a batch of RSS URLs, you can pass them to Feed's `batch` class method, which will use Typhoeus to fetch them in parallel and returns a two-element array of results and failed urls:
|
|
58
60
|
|
|
59
61
|
```ruby
|
data/lib/statement/feed.rb
CHANGED
|
@@ -41,6 +41,8 @@ module Statement
|
|
|
41
41
|
Date.parse(link.xpath('pubDate').text)
|
|
42
42
|
elsif !link.xpath('pubdate').empty?
|
|
43
43
|
Date.parse(link.xpath('pubdate').text)
|
|
44
|
+
elsif link.xpath('link').text.include?("mikulski.senate.gov") and link.xpath('link').text.include?("-2014")
|
|
45
|
+
Date.parse(link.xpath('link').text.split('/').last.split('-', -1).first(3).join('/').split('.cfm').first)
|
|
44
46
|
else
|
|
45
47
|
nil
|
|
46
48
|
end
|
data/lib/statement/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: statement
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.
|
|
4
|
+
version: 1.8.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Derek Willis
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|