simple-fluther 0.2.4 → 0.2.5

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.
@@ -1,6 +1,9 @@
1
1
  require 'simple-fluther/config'
2
2
  require 'simple-fluther/controller_methods'
3
+ require 'simple-fluther/feeds'
3
4
 
4
5
  module SimpleFluther
5
6
  ClientVersion = '1.0.2'.freeze
7
+ FederatedHost = 'http://r1.federated.fluther.com'.freeze
8
+ UserAgent = "Fluther Federated Client #{SimpleFluther::ClientVersion} (Ruby)".freeze
6
9
  end
@@ -33,7 +33,7 @@ module SimpleFluther
33
33
  end
34
34
 
35
35
  end
36
-
36
+
37
37
  def self.topic_path(t)
38
38
  t.downcase!
39
39
  t.gsub!(' ', '_')
@@ -36,7 +36,7 @@ module SimpleFluther
36
36
  :redirects => 0,
37
37
  :timeout => 10,
38
38
  :head => {
39
- 'User-Agent' => "Fluther Federated Client #{SimpleFluther::ClientVersion} (Ruby)",
39
+ 'User-Agent' => SimpleFluther::UserAgent,
40
40
  'X-Forwarded-For' => request.env['REMOTE_ADDR'],
41
41
  'X-Forwarded-Host' => request.env['HTTP_HOST'],
42
42
  'X-Forwarded-User-Agent' => request.user_agent
@@ -0,0 +1,16 @@
1
+ module SimpleFluther
2
+ class Feeds
3
+ def self.recent_owned_questions_url
4
+ "#{SimpleFluther::FederatedHost}/feeds/questions/?fed_key=#{SimpleFluther::Config.app_key}"
5
+ end
6
+
7
+ def self.recent_owned_questions_raw
8
+ begin
9
+ tmp = open(self.recent_owned_questions_url, "User-Agent" => SimpleFluther::UserAgent)
10
+ tmp.read
11
+ rescue Exception
12
+ nil
13
+ end
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-fluther
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Chen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-11 00:00:00 -08:00
18
+ date: 2010-11-23 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -46,6 +46,7 @@ files:
46
46
  - lib/simple-fluther.rb
47
47
  - lib/simple-fluther/config.rb
48
48
  - lib/simple-fluther/controller_methods.rb
49
+ - lib/simple-fluther/feeds.rb
49
50
  has_rdoc: true
50
51
  homepage: http://github.com/justinchen/simple-fluther
51
52
  licenses: []