pedrofranceschi-phtwitvid 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/phtwitvid.rb +14 -1
- data/phtwitvid.gemspec +1 -1
- metadata +2 -3
data/lib/phtwitvid.rb
CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'httparty'
|
3
3
|
require 'xmlsimple'
|
4
4
|
require 'mechanize'
|
5
|
+
require 'open-uri'
|
5
6
|
|
6
7
|
class PHTwitVid
|
7
8
|
|
@@ -68,5 +69,17 @@ class PHTwitVid
|
|
68
69
|
response = HTTParty.post("#{$api_url}/getVideos", params)
|
69
70
|
return response.body
|
70
71
|
end
|
71
|
-
|
72
|
+
|
73
|
+
def get_thumbnail_url(video_id)
|
74
|
+
return "http://cdn.twitvid.com/thumbnails/#{video_id}.jpg"
|
75
|
+
end
|
76
|
+
|
77
|
+
def profile(username)
|
78
|
+
unparsed_xml = open("http://www.twitter.com/users/show.xml?screen_name=#{username}");
|
79
|
+
xml = XmlSimple.xml_in(unparsed_xml, { 'KeyAttr' => 'name' })
|
80
|
+
return {'id' => xml['id'].to_s, 'name' => xml['name'].to_s, 'screen_name' => xml['screen_name'].to_s, 'location' => xml['location'].to_s,
|
81
|
+
'description' => xml['description'].to_s, 'url' => xml['url'].to_s, 'profile_image_url' => xml['profile_image_url'].to_s,
|
82
|
+
'followers' => xml['followers_count'].to_s, 'following' => xml['friends_count'].to_s, }
|
83
|
+
end
|
84
|
+
|
72
85
|
end
|
data/phtwitvid.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pedrofranceschi-phtwitvid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pH (Pedro Henrique Cavallieri Franceschi)
|
@@ -56,7 +56,6 @@ files:
|
|
56
56
|
- lib/phtwitvid.rb
|
57
57
|
has_rdoc: false
|
58
58
|
homepage: http://www.iBlogeek.com
|
59
|
-
licenses:
|
60
59
|
post_install_message:
|
61
60
|
rdoc_options: []
|
62
61
|
|
@@ -77,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
76
|
requirements: []
|
78
77
|
|
79
78
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.
|
79
|
+
rubygems_version: 1.2.0
|
81
80
|
signing_key:
|
82
81
|
specification_version: 2
|
83
82
|
summary: A Library for TwitVid integration written in Ruby.
|