technorati 0.0.1

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.
@@ -0,0 +1,3 @@
1
+ == 1.0.0 / 2007-12-20
2
+
3
+ * First release!
@@ -0,0 +1,7 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/technorati
6
+ lib/technorati.rb
7
+ test/test_technorati.rb
@@ -0,0 +1,54 @@
1
+ technorati
2
+ by Brian LeRoux
3
+ http://rubyforge.org/projects/technorati/
4
+
5
+ == DESCRIPTION:
6
+
7
+ A very simple wrapper for the Technorati API.
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * make any call to the technorati api and recieves the raw XML response
12
+ * TODO: use XML Simple to return pure Ruby structures
13
+ * TODO: add options hash for additional edge cases
14
+ * TODO: better testing
15
+
16
+ == SYNOPSIS:
17
+
18
+ t = Technorati.new( 'your api key' )
19
+
20
+ puts t.member_info( 'brianleroux' )
21
+ puts t.info( 'westcoastlogic.com' )
22
+
23
+ == REQUIREMENTS:
24
+
25
+ * A developer shall be able to make any call to the Technorati API with pure Ruby and receive the XML response.
26
+
27
+ == INSTALL:
28
+
29
+ * sudo gem install technorati
30
+
31
+ == LICENSE:
32
+
33
+ (The MIT License)
34
+
35
+ Copyright (c) 2007 FIX
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining
38
+ a copy of this software and associated documentation files (the
39
+ 'Software'), to deal in the Software without restriction, including
40
+ without limitation the rights to use, copy, modify, merge, publish,
41
+ distribute, sublicense, and/or sell copies of the Software, and to
42
+ permit persons to whom the Software is furnished to do so, subject to
43
+ the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be
46
+ included in all copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
49
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
51
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
52
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
53
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
54
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+ require './lib/technorati.rb'
6
+
7
+ Hoe.new('technorati', Technorati::VERSION) do |p|
8
+ p.rubyforge_name = 'technorati'
9
+ p.author = 'Brian LeRoux'
10
+ p.email = 'brian.leroux@westcoastlogic.com'
11
+ p.summary = 'A very simple wrapper for the Technorati API'
12
+ p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
13
+ p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
14
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
15
+ p.remote_rdoc_dir = ''
16
+ end
17
+
18
+ # vim: syntax=Ruby
File without changes
@@ -0,0 +1,58 @@
1
+ require 'net/http'
2
+
3
+ class Technorati
4
+
5
+ VERSION = '0.0.1'
6
+
7
+ attr_accessor :key, :base_url
8
+
9
+ def initialize( key )
10
+ @key, @base_url = key, "http://api.technorati.com"
11
+ end
12
+
13
+ # helper method for fetching an http response for a get request
14
+ def get( url )
15
+ Net::HTTP.get_response( URI.parse( "#{ @base_url }#{ url }" )).body
16
+ end
17
+
18
+ # Information about a Technorati member such as full name and other blogs by the same author.
19
+ def member_info( technorati_username )
20
+ get "/getinfo?key=#{ @key }&username=#{ technorati_username }"
21
+ end
22
+
23
+ # Top tags indexed by Technorati.
24
+ def top_tags
25
+ get "/toptags?key=#{ @key }"
26
+ end
27
+
28
+ # Blogs linking to a given URL.
29
+ def cosmos( url, options={} )
30
+ get "/cosmos?key=#{ @key }&url=#{ url }"
31
+ end
32
+
33
+ # Blog posts featuring a given keyword or phrase.
34
+ def search( query, options={} )
35
+ get "/search?key=#{ @key }&query=#{ query }"
36
+ end
37
+
38
+ # Blog posts tagged with a specific topic.
39
+ def tag( tag )
40
+ get "/tag?key=#{ @key }&tag=#{ tag }"
41
+ end
42
+
43
+ # Daily counts of posts containing the queried keyword.
44
+ def daily_counts( q )
45
+ get "/dailycounts?key=#{ @key }&q=#{ q }"
46
+ end
47
+
48
+ # Information about a specific blog URL such as link counts, rank, and available feeds.
49
+ def info( url )
50
+ get "/bloginfo?key=#{ @key }&url=#{ url }"
51
+ end
52
+
53
+ # The top tags used by a specific blog.
54
+ def post_tags( url )
55
+ get "/blogposttags?key=#{ @key }&url=#{ url }"
56
+ end
57
+ #
58
+ end
@@ -0,0 +1,17 @@
1
+ require 'lib/technorati.rb'
2
+
3
+ describe Technorati, " when first created" do
4
+
5
+ before do
6
+ @t = Technorati.new('foo')
7
+ end
8
+
9
+ it "should have an api key" do
10
+ @t.key.should eql('foo')
11
+ end
12
+
13
+ after do
14
+ @t = nil
15
+ end
16
+
17
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.4
3
+ specification_version: 1
4
+ name: technorati
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.0.1
7
+ date: 2007-12-20 00:00:00 -08:00
8
+ summary: A very simple wrapper for the Technorati API
9
+ require_paths:
10
+ - lib
11
+ email: brian.leroux@westcoastlogic.com
12
+ homepage: " by Brian LeRoux"
13
+ rubyforge_project: technorati
14
+ description: "== FEATURES/PROBLEMS: * make any call to the technorati api and recieves the raw XML response * TODO: use XML Simple to return pure Ruby structures * TODO: add options hash for additional edge cases * TODO: better testing == SYNOPSIS: t = Technorati.new( 'your api key' ) puts t.member_info( 'brianleroux' ) puts t.info( 'westcoastlogic.com' )"
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Brian LeRoux
31
+ files:
32
+ - History.txt
33
+ - Manifest.txt
34
+ - README.txt
35
+ - Rakefile
36
+ - bin/technorati
37
+ - lib/technorati.rb
38
+ - test/test_technorati.rb
39
+ test_files:
40
+ - test/test_technorati.rb
41
+ rdoc_options:
42
+ - --main
43
+ - README.txt
44
+ extra_rdoc_files:
45
+ - History.txt
46
+ - Manifest.txt
47
+ - README.txt
48
+ executables:
49
+ - technorati
50
+ extensions: []
51
+
52
+ requirements: []
53
+
54
+ dependencies:
55
+ - !ruby/object:Gem::Dependency
56
+ name: hoe
57
+ version_requirement:
58
+ version_requirements: !ruby/object:Gem::Version::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 1.3.0
63
+ version: