technorati 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Manifest.txt +7 -0
- data/README.txt +54 -0
- data/Rakefile +18 -0
- data/bin/technorati +0 -0
- data/lib/technorati.rb +58 -0
- data/test/test_technorati.rb +17 -0
- metadata +63 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -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.
|
data/Rakefile
ADDED
@@ -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
|
data/bin/technorati
ADDED
File without changes
|
data/lib/technorati.rb
ADDED
@@ -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
|
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:
|