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.
@@ -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!
@@ -1,3 +1,3 @@
1
1
  module TwitterArchive
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -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
+ &lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;
5
+
6
+ &lt;table class='twitter'&gt;
7
+ &lt;tbody class='twitter'&gt;
8
+
9
+ &lt;tr class='twitter-status u-fuzzymonk'&gt;
10
+ &lt;td class=''&gt;
11
+ &lt;a class='url' href='http://twitter.com/fuzzymonk'&gt;
12
+ &lt;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'/&gt;
13
+ &lt;/a&gt;
14
+ &lt;/td&gt;
15
+ &lt;td class='twitter-body'&gt;
16
+ &lt;div&gt;
17
+ &lt;strong&gt;
18
+ &lt;a title='fuzzymonk' class='twitter-user' href='http://twitter.com/fuzzymonk'&gt;
19
+ fuzzymonk
20
+ &lt;/a&gt;
21
+ &lt;/strong&gt;
22
+ &lt;span class='twitter-text'&gt;
23
+ Wearing my twitter shirt
24
+ &lt;/span&gt;
25
+ &lt;span style='font-style: italic; font-size:smaller;' class='twitter-date'&gt;
26
+ 01/03/2009 at 01:31AM
27
+ &lt;/span&gt;
28
+ &lt;/div&gt;
29
+ &lt;/td&gt;
30
+ &lt;/tr&gt;
31
+
32
+ &lt;tr class='twitter-status u-fuzzymonk'&gt;
33
+ &lt;td class=''&gt;
34
+ &lt;a class='url' href='http://twitter.com/fuzzymonk'&gt;
35
+ &lt;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'/&gt;
36
+ &lt;/a&gt;
37
+ &lt;/td&gt;
38
+ &lt;td class='twitter-body'&gt;
39
+ &lt;div&gt;
40
+ &lt;strong&gt;
41
+ &lt;a title='fuzzymonk' class='twitter-user' href='http://twitter.com/fuzzymonk'&gt;
42
+ fuzzymonk
43
+ &lt;/a&gt;
44
+ &lt;/strong&gt;
45
+ &lt;span class='twitter-text'&gt;
46
+ MBP keeps forgetting its keyboard and trackpad. Sad panda.
47
+ &lt;/span&gt;
48
+ &lt;span style='font-style: italic; font-size:smaller;' class='twitter-date'&gt;
49
+ 01/02/2009 at 11:31PM
50
+ &lt;/span&gt;
51
+ &lt;/div&gt;
52
+ &lt;/td&gt;
53
+ &lt;/tr&gt;
54
+
55
+ &lt;/tbody&gt;
56
+
57
+ &lt;/table&gt;
58
+ &lt;/div&gt;
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&amp;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
+
@@ -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"
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", "joe", "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/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"]
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.5
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