csexton-twitter_archive 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twitter_archive/backends/blogger/blogger.rb +4 -1
- data/lib/twitter_archive/backends/blogger_archive.rb +1 -1
- data/lib/twitter_archive/runner.rb +1 -4
- data/lib/twitter_archive/version.rb +1 -1
- data/spec/fixtures/blogger_post_response.yml +93 -0
- data/twitter_archive.gemspec +2 -2
- metadata +2 -2
@@ -52,7 +52,7 @@ module GData
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Creates a new entry with the given title and body
|
55
|
-
def entry(title, body)
|
55
|
+
def entry(title, body, labels=[])
|
56
56
|
x = Builder::XmlMarkup.new :indent => 2
|
57
57
|
@entry = x.entry 'xmlns' => 'http://www.w3.org/2005/Atom' do
|
58
58
|
x.title title, 'type' => 'text'
|
@@ -61,6 +61,9 @@ module GData
|
|
61
61
|
x << body
|
62
62
|
end
|
63
63
|
end
|
64
|
+
labels.each do |label|
|
65
|
+
x.category 'scheme' => "http://www.blogger.com/atom/ns#", 'term' => label
|
66
|
+
end
|
64
67
|
end
|
65
68
|
|
66
69
|
path = "/feeds/#{@blog_id}/posts/default"
|
@@ -8,7 +8,7 @@ module TwitterArchive
|
|
8
8
|
if twitter_results.length > 0
|
9
9
|
blogger = GData::Blogger.new(opts['blogger_id'])
|
10
10
|
blogger.authenticate(opts['blogger_user'], opts['blogger_pass'])
|
11
|
-
blogger.entry(opts['blogger_title'] || 'Twitter', format_post(twitter_results))
|
11
|
+
blogger.entry(opts['blogger_title'] || 'Twitter', format_post(twitter_results), ['twitter'])
|
12
12
|
"Posting to blogger id #{opts['blogger_id']}, user #{opts['blogger_user']}"
|
13
13
|
else
|
14
14
|
"Nothing to post to blogger"
|
@@ -21,8 +21,7 @@ module TwitterArchive
|
|
21
21
|
end
|
22
22
|
|
23
23
|
@ta.load_config
|
24
|
-
|
25
|
-
puts @ta.get_latest
|
24
|
+
@ta.get_latest
|
26
25
|
@ta.save_config
|
27
26
|
end
|
28
27
|
|
@@ -54,8 +53,6 @@ module TwitterArchive
|
|
54
53
|
end
|
55
54
|
opts.on('-cFILE', '--config FILE') do |file|
|
56
55
|
@ta.config_file = file
|
57
|
-
puts "Config file: #{file}"
|
58
|
-
exit
|
59
56
|
end
|
60
57
|
|
61
58
|
end.parse!
|
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Net::HTTPCreated
|
2
|
+
body: |-
|
3
|
+
<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><entry xmlns='http://www.w3.org/2005/Atom'><id>tag:blogger.com,1999:blog-5555555555555555555.post-88888888888888888</id><published>2009-01-03T12:44:00.001-08:00</published><updated>2009-01-03T12:44:06.658-08:00</updated><app:edited xmlns:app='http://purl.org/atom/app#'>2009-01-03T12:44:06.658-08:00</app:edited><title type='text'>Twitter</title><content type='html'>
|
4
|
+
<div xmlns='http://www.w3.org/1999/xhtml'>
|
5
|
+
|
6
|
+
<table class='twitter'>
|
7
|
+
<tbody class='twitter'>
|
8
|
+
|
9
|
+
<tr class='twitter-status u-fuzzymonk'>
|
10
|
+
<td class=''>
|
11
|
+
<a class='url' href='http://twitter.com/fuzzymonk'>
|
12
|
+
<img width='48' src='http://s3.amazonaws.com/twitter_production/profile_images/30300852/TaylorandMcLauren-jabber_normal.jpg' height='48' class='twitter-avatar' alt='Tom Dougherty'/>
|
13
|
+
</a>
|
14
|
+
</td>
|
15
|
+
<td class='twitter-body'>
|
16
|
+
<div>
|
17
|
+
<strong>
|
18
|
+
<a title='fuzzymonk' class='twitter-user' href='http://twitter.com/fuzzymonk'>
|
19
|
+
fuzzymonk
|
20
|
+
</a>
|
21
|
+
</strong>
|
22
|
+
<span class='twitter-text'>
|
23
|
+
Wearing my twitter shirt
|
24
|
+
</span>
|
25
|
+
<span style='font-style: italic; font-size:smaller;' class='twitter-date'>
|
26
|
+
01/03/2009 at 01:31AM
|
27
|
+
</span>
|
28
|
+
</div>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
|
32
|
+
<tr class='twitter-status u-fuzzymonk'>
|
33
|
+
<td class=''>
|
34
|
+
<a class='url' href='http://twitter.com/fuzzymonk'>
|
35
|
+
<img width='48' src='http://s3.amazonaws.com/twitter_production/profile_images/30300852/TaylorandMcLauren-jabber_normal.jpg' height='48' class='twitter-avatar' alt='Tom Dougherty'/>
|
36
|
+
</a>
|
37
|
+
</td>
|
38
|
+
<td class='twitter-body'>
|
39
|
+
<div>
|
40
|
+
<strong>
|
41
|
+
<a title='fuzzymonk' class='twitter-user' href='http://twitter.com/fuzzymonk'>
|
42
|
+
fuzzymonk
|
43
|
+
</a>
|
44
|
+
</strong>
|
45
|
+
<span class='twitter-text'>
|
46
|
+
MBP keeps forgetting its keyboard and trackpad. Sad panda.
|
47
|
+
</span>
|
48
|
+
<span style='font-style: italic; font-size:smaller;' class='twitter-date'>
|
49
|
+
01/02/2009 at 11:31PM
|
50
|
+
</span>
|
51
|
+
</div>
|
52
|
+
</td>
|
53
|
+
</tr>
|
54
|
+
|
55
|
+
</tbody>
|
56
|
+
|
57
|
+
</table>
|
58
|
+
</div>
|
59
|
+
</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/1111111111111111111/88888888888888888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=1111111111111111111&postID=77777777777777777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5555555555555555555/posts/default/88888888888888888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5555555555555555555/posts/default/88888888888888888'/><link rel='alternate' type='text/html' href='http://www.example.com/2009/01/twitter_03.html' title='Twitter'/><author><name>Name</name><uri>http://www.blogger.com/profile/11111111111111111111</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry>
|
60
|
+
body_exist: true
|
61
|
+
code: "201"
|
62
|
+
header:
|
63
|
+
vary:
|
64
|
+
- Accept, GData-Version
|
65
|
+
cache-control:
|
66
|
+
- private, max-age=0, must-revalidate
|
67
|
+
connection:
|
68
|
+
- Close
|
69
|
+
x-content-type-options:
|
70
|
+
- nosniff
|
71
|
+
content-location:
|
72
|
+
- http://www.blogger.com/feeds/1111111111111111111/posts/default/88888888888888888
|
73
|
+
expires:
|
74
|
+
- Sat, 03 Jan 2009 20:44:06 GMT
|
75
|
+
etag:
|
76
|
+
- W/"D0MAR3g-cCp7ImA9WxVSEEw."
|
77
|
+
date:
|
78
|
+
- Sat, 03 Jan 2009 20:44:07 GMT
|
79
|
+
content-type:
|
80
|
+
- application/atom+xml; charset=UTF-8; type=entry
|
81
|
+
gdata-version:
|
82
|
+
- "2.0"
|
83
|
+
server:
|
84
|
+
- GFE/1.3
|
85
|
+
transfer-encoding:
|
86
|
+
- chunked
|
87
|
+
location:
|
88
|
+
- http://www.blogger.com/feeds/1111111111111111111/posts/default/88888888888888888
|
89
|
+
http_version: "1.1"
|
90
|
+
message: Created
|
91
|
+
read: true
|
92
|
+
socket:
|
93
|
+
|
data/twitter_archive.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{twitter_archive}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Christohper Sexton"]
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.email = %q{csexton@gmail.com}
|
13
13
|
s.executables = ["twitter_archive"]
|
14
14
|
s.extra_rdoc_files = ["bin/twitter_archive", "lib/twitter_archive/backends/blogger/base.rb", "lib/twitter_archive/backends/blogger/blogger.rb", "lib/twitter_archive/backends/blogger/post_body.html.erb", "lib/twitter_archive/backends/blogger/README", "lib/twitter_archive/backends/blogger_archive.rb", "lib/twitter_archive/backends/yaml_archive.rb", "lib/twitter_archive/base.rb", "lib/twitter_archive/rdoc_readme.rb", "lib/twitter_archive/runner.rb", "lib/twitter_archive/version.rb", "lib/twitter_archive.rb", "LICENSE", "README.rdoc", "tasks/rspec.rake"]
|
15
|
-
s.files = ["bin/twitter_archive", "config/example.yml", "config/test.yml", "History", "
|
15
|
+
s.files = ["bin/twitter_archive", "config/example.yml", "config/test.yml", "History", "lib/twitter_archive/backends/blogger/base.rb", "lib/twitter_archive/backends/blogger/blogger.rb", "lib/twitter_archive/backends/blogger/post_body.html.erb", "lib/twitter_archive/backends/blogger/README", "lib/twitter_archive/backends/blogger_archive.rb", "lib/twitter_archive/backends/yaml_archive.rb", "lib/twitter_archive/base.rb", "lib/twitter_archive/rdoc_readme.rb", "lib/twitter_archive/runner.rb", "lib/twitter_archive/version.rb", "lib/twitter_archive.rb", "LICENSE", "Manifest", "Rakefile", "README.rdoc", "script/console", "script/destroy", "script/generate", "spec/backends/blogger_archive_spec.rb", "spec/backends/yaml_archive_spec.rb", "spec/fixtures/blogger_authenticate_response.yml", "spec/fixtures/blogger_post_response.yml", "spec/fixtures/twitter_response.yml", "spec/spec.opts", "spec/spec_helper.rb", "spec/twitter_archive_spec.rb", "tasks/rspec.rake", "tmp/test_yaml_archive.yml", "twitter_archive.gemspec"]
|
16
16
|
s.has_rdoc = true
|
17
17
|
s.homepage = %q{http://github.com/csexton/twitter_archive}
|
18
18
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Twitter_archive", "--main", "README.rdoc"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csexton-twitter_archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christohper Sexton
|
@@ -66,7 +66,6 @@ files:
|
|
66
66
|
- config/example.yml
|
67
67
|
- config/test.yml
|
68
68
|
- History
|
69
|
-
- joe
|
70
69
|
- lib/twitter_archive/backends/blogger/base.rb
|
71
70
|
- lib/twitter_archive/backends/blogger/blogger.rb
|
72
71
|
- lib/twitter_archive/backends/blogger/post_body.html.erb
|
@@ -88,6 +87,7 @@ files:
|
|
88
87
|
- spec/backends/blogger_archive_spec.rb
|
89
88
|
- spec/backends/yaml_archive_spec.rb
|
90
89
|
- spec/fixtures/blogger_authenticate_response.yml
|
90
|
+
- spec/fixtures/blogger_post_response.yml
|
91
91
|
- spec/fixtures/twitter_response.yml
|
92
92
|
- spec/spec.opts
|
93
93
|
- spec/spec_helper.rb
|