tweetlr 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -4,6 +4,7 @@ bundler_args: --binstubs
4
4
  # Specify which ruby versions you wish to run your tests on, each version will be used
5
5
  rvm:
6
6
  - 1.9.2
7
+ - 1.9.3
7
8
  #- 1.8.7 # (current default)
8
9
 
9
10
  # Define how to run your tests (defaults to `bundle exec rake` or `rake` depending on whether you have a `Gemfile`)
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  == tweetlr
2
2
 
3
- Copyright (c) 2011 Sven Kraeuter sven.kraeuter@gmx.net
3
+ Copyright (c) 2011 Sven Kraeuter sven.kraeuter@gmail.com
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -10,7 +10,7 @@ There is a new [tweetlr "as-a-service"](http://tweetlr.5v3n.com) where you can e
10
10
 
11
11
  tweetlr supports
12
12
 
13
- - instagram
13
+ - eyeem.com
14
14
  - twitter / photobucket
15
15
  - foursquare
16
16
  - path.com
@@ -18,9 +18,9 @@ tweetlr supports
18
18
  - twitpic
19
19
  - yfrog
20
20
  - imgly
21
+ - instagram
21
22
  - t.co shortened links to pictures
22
23
  - every photo service accessible via embed.ly (see [photo providers](http://embed.ly/providers))
23
- - plus every service that delivers a thumbnail via embed.ly
24
24
 
25
25
 
26
26
  ## Installation
@@ -19,6 +19,7 @@ module Processors
19
19
  def self.find_image_url(link, embedly_key=nil)
20
20
  url = nil
21
21
  if link && !(photo? link)
22
+ url = image_url_eyeem link if link.index 'eyeem.com'
22
23
  url = image_url_instagram link if (link.index('instagr.am') || link.index('instagram.com'))
23
24
  url = image_url_picplz link if link.index 'picplz'
24
25
  url = image_url_twitpic link if link.index 'twitpic'
@@ -38,6 +39,14 @@ module Processors
38
39
  def self.photo?(link)
39
40
  link =~ PIC_REGEXP
40
41
  end
42
+ #extract the image of an eyeem.com pic
43
+ def self.image_url_eyeem(link_url)
44
+ service_url = link_url_redirect link_url #follow possible redirects
45
+ link_url = service_url if service_url #if there's no redirect, service_url will be nil
46
+ response = Processors::Http::http_get link_url
47
+ image_url = parse_html_for '.viewport-pic img', Nokogiri::HTML.parse(response.body_str)
48
+ return image_url
49
+ end
41
50
  #extract the image of a foursquare.com pic
42
51
  def self.image_url_foursqaure(link_url)
43
52
  service_url = link_url_redirect link_url #follow possible redirects
@@ -3,6 +3,7 @@ require 'spec_helper'
3
3
  describe Processors::PhotoService do
4
4
  before :each do
5
5
  @links = {
6
+ :eyeem => 'http://www.eyeem.com/p/326629',
6
7
  :foursquare => 'http://4sq.com/x4p87N',
7
8
  :path => 'http://path.com/p/KQd57',
8
9
  :instagram => "http://instagr.am/p/DzCWn/",
@@ -16,6 +17,12 @@ describe Processors::PhotoService do
16
17
  :twitter_pics => 'http://t.co/FmyBGfyY'
17
18
  }
18
19
  end
20
+ it "extracts images from eye em" do
21
+ stub_eyeem
22
+ link = Processors::PhotoService::find_image_url @links[:eyeem]
23
+ link.should be
24
+ link.should == "http://www.eyeem.com/thumb/h/1024/e35db836c5d3f02498ef60fc3d53837fbe621561-1334126483"
25
+ end
19
26
  it "doesnt find images in embedly results that are not explicitly marked as 'Photo' via the response's 'thumbnail_url' attribute" do
20
27
  stub_embedly_no_photo
21
28
  link = Processors::PhotoService::find_image_url 'http://makersand.co/'
data/spec/spec_helper.rb CHANGED
@@ -994,4 +994,10 @@ def stub_foursquare
994
994
  ^
995
995
  end
996
996
 
997
+ def stub_eyeem
998
+ Curl::Easy.any_instance.stub(:perform).and_return Curl::Easy.new
999
+ Curl::Easy.any_instance.stub(:header_str).and_return "HTTP/1.1 200 OK\r\nServer: nginx/1.0.5\r\nDate: Sun, 15 Apr 2012 09:16:58 GMT\r\nContent-Type: text/html; charset=utf-8\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nX-Powered-By: PHP/5.3.6-13ubuntu3.6\r\nSet-Cookie: symfony=bv8mdicp6ucb8jr9qt0o0r7qk2; path=/\r\nExpires: Thu, 19 Nov 1981 08:52:00 GMT\r\nCache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\nPragma: no-cache\r\n\r\n"
1000
+ Curl::Easy.any_instance.stub(:body_str).and_return "<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta charset=\"utf-8\"/>\n<link rel=\"shortcut icon\" href=\"/favicon.ico\" />\n<meta name=\"title\" content=\"EyeEm\" />\n<meta name=\"description\" content=\"EyeEm is a photo-sharing and discovery app that connects people through the photos they take. Snap a photo and see where it takes you! It&#039;s free.\" />\n<title>EyeEm</title>\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"/css/eyeem.c.css?1334330223\" />\n <meta content=\"EyeEm\" property=\"og:title\">\n<meta content=\"website\" property=\"og:type\">\n<meta content=\"EyeEm\" property=\"og:site_name\">\n<meta content=\"http://www.eyeem.com/p/326629\" property=\"og:url\">\n<meta content=\"http://www.eyeem.com/thumb/640/480/e35db836c5d3f02498ef60fc3d53837fbe621561-1334126483\" property=\"og:image\">\n<meta content=\"EyeEm is a photo-sharing and discovery app that connects people through the photos they take. Snap a photo and see where it takes you! It's free.\" property=\"og:description\">\n<meta content=\"138146182878222\" property=\"fb:app_id\">\n<script type=\"text/javascript\">\n\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-12590370-2']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n\n</script>\n</head>\n<body>\n\n<div id=\"fb-root\">\n <!-- you must include this div for the JS SDK to load properly -->\n</div>\n<script>\n window.fbAsyncInit = function() {\n FB.init({\n appId : '138146182878222', // App ID\n channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File\n status : true, // check login status\n cookie : true, // enable cookies to allow the server to access the session\n xfbml : true // parse XFBML\n });\n\n // Additional initialization code here\n };\n\n // Load the SDK Asynchronously\n (function(d){\n var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];\n if (d.getElementById(id)) {return;}\n js = d.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\";\n ref.parentNode.insertBefore(js, ref);\n }(document));\n</script>\n \n \n\n\n <div id=\"page\">\n <div id=\"header\">\n <div name=\"top\" class=\"top_bar\"><div class=\"top_bar-inner\">\n <div class=\"padding-top\"></div>\n <div class=\"top_bar_content\">\n <div class=\"search_box\">\n \t<form action=\"/search\" method=\"get\" enctype=\"application/x-www-form-urlencoded\">\n <input type=\"text\" name=\"query\" class=\"search_form_query\" placeholder=\"Search\" id=\"query\" /> <!-- \t <input class=\"search_form_submit\" type=\"image\" value=\"submit\" src=\"\"/> -->\n \t <input class=\"search_form_submit\" type=\"submit\" value=\"\" />\n \t</form>\n </div>\n <div class=\"homelink\">\n \t<a href=\"/\">\n <img src=\"/images/layout/topbar_logo.png\">\n \t</a>\n </div>\n \n \n \n <div class=\"top_menus\">\n <div class=\"top_menu user_menu\">\n \t\t <a class=\"user_login smooth_hover\" href=\"/login\">\n \t\t\t\t<span class=\"\">Login</span>\n \t\t </a>\n </div>\n \n \n \n <div class=\"top_menu about_menu\">\n \t\t <a class=\"top_menu_button about_box smooth_hover\" href=\"javascript:void(0)\">\n \t\t\t\t<span class=\"about_name\">About</span>\n \t\t <img class=\"more_triangle\" src=\"/images/layout/topbar_triangle.png\">\n \t\t </a>\n \t\t <ul class=\"\">\n \t\t<li class=\"hidden\"><a class=\"smooth_hover\" href=\"/whatiseyeem\"><span>What is EyeEm?</span></a></li>\n \t\t<li class=\"hidden\"><a class=\"smooth_hover\" href=\"/gettheapp\"><span>Download the App</span></a></li>\n \t\t<li class=\"hidden\"><a class=\"smooth_hover\" href=\"/contact\"><span>Contact and Press</span></a></li>\n \t\t<li class=\"hidden\"><a class=\"smooth_hover\" href=\"/team\"><span>Team & Jobs</span></a></li>\n \t\t<li class=\"hidden\"><a class=\"smooth_hover\" href=\"http://blog.eyeem.com\" target=\"_blank\"><span>Blog</span></a></li>\n \t\t<li class=\"hidden\"><a class=\"smooth_hover\" href=\"/pages/service.html\"><span>Terms of service</span></a></li>\n \t\t </ul>\n </div> \n </div>\n \n </div>\n</div></div>\n <div class=\"top_bar_back\"></div>\n </div> <!-- /#header -->\n <div id=\"content\">\n \n\n<div class=\"join_block\">\n <div class=\"join_inner\">\n <span class=\"join_description\">\n <p>Take &amp; Discover photos</p>\n <p>together with EyeEm!</p>\n </span>\n <div class=\"join_now\">\n <div><a class=\"eyeem_button join_button\" href=\"/signup\">Join now!</a></div>\n <div class=\"learn_more\"><a class=\"\" href=\"/whatiseyeem\">Learn more</a></div>\n </div>\n </div>\n</div>\n<div class=\"inner-content photo_inner_content\">\n <div class=\"photo_indicator\"><img src=\"/images/layout/triangle_indicator.png\"></div>\n <div class=\"viewports-wrapper\">\n <div class=\"viewport active\" data-photo-id=\"326629\">\n \n\n <div class=\"viewport-user\">\n \t<a href=\"/u/8157\">\n \t\t<img class=\"user_face\" src=\"http://www.eyeem.com/thumb/sq/50/2033ff7cc732c4b8e1ee4375aa00b16d365b51c7.jpg\">\n \t</a>\n \t<span class=\"user_text\">\n \t<a class=\"user_name\" href=\"/u/8157\">\n \t\t<span><h2>Sven Kr\xC3\xA4uter</h2></span>\n \t</a>\n \t<div class=\"meta\">\n <div class=\"viewport-age\">\n \t <span>4</span> days ago </div>\n \t</div>\n \t</span>\n </div> \t\t\n \t\t\n \t\t\n <div class=\"viewport-pic\">\n <img src=\"http://www.eyeem.com/thumb/h/1024/e35db836c5d3f02498ef60fc3d53837fbe621561-1334126483\">\n </div>\n \n \n <div class=\"viewport-albums\">\n <div class=\"tags tags_arrow\">\n \n \n <div class=\"album_tag_box hover_container\">\n <a class=\"album_tag tag\" href=\"/a/168255\">#coffeediary</a>\n </div> \t \t\n \t </div>\n <div class=\"places tags_arrow\">\n \t </div>\n </div>\n \n \n\n <div class=\"viewport-likes\">\n <div class=\"likes_count count\">1 like</div>\n <span class=\"user_thumbs\">\n <a class=\"user_thumb hover_container\" href=\"/u/85456\">\n <img class=\"user_face\" alt=\"filtercake-nophoto\" src=\"http://www.eyeem.com/thumb/sq/50/a5799d443153b9becad3a1e15d15c1ad79739f32.jpg\">\n </a>\n </span>\n \t<span class=\"like_area\">\n <div class=\"like_action action\">\n \t \t\t \t\t\t<a class=\"photo_like eyeem_button like_button\" href=\"javascript:void(0)\">Like<img class=\"button_spinner\" src=\"/images/layout/spinner.gif\"></a>\n \t\t \t </div> \t\n \t\n \t</span>\n </div>\n \n \n <div class=\"viewport-comments\">\n \t<div class=\"comments_count count\">1 comment</div>\n \t \t<div class=\"comment_box\">\n <a class=\"user_face_link\" href=\"/u/8157\">\n <img class=\"user_face\" src=\"http://www.eyeem.com/thumb/sq/50/2033ff7cc732c4b8e1ee4375aa00b16d365b51c7.jpg\">\n </a>\n <span class=\"comment_display\">\n <a class=\"user_name\" href=\"/u/8157\">\n Sven Kr\xC3\xA4uter </a>\n <div class=\"comment_body\">\n still using the bialetti until the spare parts for the espresso machine arrive. quite cozy actually. </div>\n <div class=\"comment_age\"><span>4</span> days ago</div>\n </span>\n</div>\n \t </div>\n \n <div class=\"viewport-social\">\n <div class=\"social\">\n <div class=\"twitter-like\">\n <script src=\"http://platform.twitter.com/widgets.js\" type=\"text/javascript\"></script>\n <a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://www.eyeem.com/p/326629\">Tweet</a>\n </div>\n <div class=\"facebook-like\">\n <div class=\"fb-like\" data-href=\"http://www.eyeem.com/p/326629\" data-send=\"false\" data-layout=\"button_count\" data-width=\"20\" data-show-faces=\"false\" data-font=\"verdana\"></div>\n </div>\n </div>\n </div>\n\n </div>\n </div>\n</div> </div> <!-- /#content -->\n </div> <!-- /#page -->\n \n <script type=\"text/javascript\">\n var app_url = 'http://www.eyeem.com/';\nvar signup_url = 'http://www.eyeem.com/signup';\nvar authenticated = false;\n </script>\n\n <script type=\"text/javascript\" src=\"/js/eyeem.c.js?1334330223\"></script>\n\n</body>\n</html>"
1001
+ end
1002
+
997
1003
 
data/tweetlr.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "tweetlr"
3
- s.version = "0.1.13"
3
+ s.version = "0.1.14"
4
4
  s.author = "Sven Kraeuter"
5
5
  s.email = "sven.kraeuter@gmail.com"
6
6
  s.homepage = "http://tweetlr.5v3n.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tweetlr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-24 00:00:00.000000000Z
12
+ date: 2012-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: daemons
16
- requirement: &2153880220 !ruby/object:Gem::Requirement
16
+ requirement: &2156435720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153880220
24
+ version_requirements: *2156435720
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: eventmachine
27
- requirement: &2153879780 !ruby/object:Gem::Requirement
27
+ requirement: &2156435200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153879780
35
+ version_requirements: *2156435200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: curb
38
- requirement: &2153879360 !ruby/object:Gem::Requirement
38
+ requirement: &2156434700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2153879360
46
+ version_requirements: *2156434700
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: json
49
- requirement: &2153878940 !ruby/object:Gem::Requirement
49
+ requirement: &2156434200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2153878940
57
+ version_requirements: *2156434200
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &2153878520 !ruby/object:Gem::Requirement
60
+ requirement: &2156433720 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2153878520
68
+ version_requirements: *2156433720
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
- requirement: &2153878100 !ruby/object:Gem::Requirement
71
+ requirement: &2156433220 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2153878100
79
+ version_requirements: *2156433220
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &2153877680 !ruby/object:Gem::Requirement
82
+ requirement: &2156432400 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2153877680
90
+ version_requirements: *2156432400
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rdoc
93
- requirement: &2153877260 !ruby/object:Gem::Requirement
93
+ requirement: &2156431860 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2153877260
101
+ version_requirements: *2156431860
102
102
  description: tweetlr crawls twitter for a given term, extracts photos out of the collected
103
103
  tweets' short urls and posts the images to tumblr.
104
104
  email: sven.kraeuter@gmail.com
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project: tweetlr
155
- rubygems_version: 1.8.15
155
+ rubygems_version: 1.8.16
156
156
  signing_key:
157
157
  specification_version: 3
158
158
  summary: tweetlr crawls twitter for a given term, extracts photos out of the collected