buzz_feed 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -3
- data/lib/buzz_feed/client.rb +12 -4
- data/lib/buzz_feed/version.rb +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
It is popular to have a "Buzz From The Web" widget on the site. This plugin will allow you
|
4
4
|
just that.
|
5
|
-
Use this plugin for automated combining RSS/Atom links from various internet sources. It
|
6
|
-
background worker that periodically updates the Buzz model with fresh RSS/Atom
|
7
|
-
sources you define.
|
5
|
+
Use this plugin for automated combining of RSS/Atom links from various internet sources. It
|
6
|
+
provides a background worker that periodically updates the Buzz model with fresh RSS/Atom
|
7
|
+
links from sources you define.
|
8
8
|
|
9
9
|
|
10
10
|
== Installation (Rails 3 ready)
|
@@ -50,6 +50,10 @@ You can manually read a feed like this:
|
|
50
50
|
To manually update the Buzz model with fresh links do this:
|
51
51
|
|
52
52
|
BuzzFeed::Client.update('smashingmagazine')
|
53
|
+
|
54
|
+
In case you would like to update all services do this:
|
55
|
+
|
56
|
+
BuzzFeed::Client.update_all
|
53
57
|
|
54
58
|
You can list all defined service names like this:
|
55
59
|
|
data/lib/buzz_feed/client.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module BuzzFeed
|
2
2
|
module Client
|
3
3
|
|
4
|
-
# Lists all defined services
|
4
|
+
# Lists all defined services.
|
5
5
|
def self.service_names
|
6
6
|
list = []
|
7
7
|
service = BuzzFeed.config['service'].keys.each do |name|
|
@@ -9,12 +9,12 @@ module BuzzFeed
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
# Returns data of a service
|
12
|
+
# Returns data of a service.
|
13
13
|
def self.read(name)
|
14
14
|
read_blogspot(BuzzFeed.config['service'][name]['url'])
|
15
15
|
end
|
16
16
|
|
17
|
-
# Updates the Buzz model with fresh links from the service
|
17
|
+
# Updates the Buzz model with fresh links from the service.
|
18
18
|
def self.update(name)
|
19
19
|
fresh_data = self.read(name)
|
20
20
|
fresh_ids = fresh_data.map{|b| b[:id]}
|
@@ -27,7 +27,15 @@ module BuzzFeed
|
|
27
27
|
end
|
28
28
|
true
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
|
+
# Updates the Buzz model with fresh links from all available services.
|
32
|
+
def self.update_all
|
33
|
+
self.service_names.each do |name|
|
34
|
+
self.update(name)
|
35
|
+
end
|
36
|
+
true
|
37
|
+
end
|
38
|
+
|
31
39
|
protected
|
32
40
|
|
33
41
|
def self.read_blogspot(url)
|
data/lib/buzz_feed/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buzz_feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kristijan Sedlak
|