Module: FbParse
- Defined in:
- lib/fb_parse.rb,
lib/fb_parse/version.rb
Constant Summary collapse
- VERSION =
"0.0.7"
Class Method Summary collapse
- .get_id_embed(code) ⇒ Object
- .get_id_feed(url) ⇒ Object
- .get_id_photo_other(url) ⇒ Object
- .get_id_photo_video(url) ⇒ Object
- .get_id_status_link_checkin(url) ⇒ Object
- .get_id_url(url) ⇒ Object
Class Method Details
.get_id_embed(code) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/fb_parse.rb', line 4 def self.(code) url = URI.extract(code)[0] if url.include? '?fbid=' self.get_id_photo_video(url) elsif url.include? 'activity' self.get_id_feed(url) elsif url.include? 'photos' self.get_id_photo_other(url) else self.get_id_status_link_checkin(url) end end |
.get_id_feed(url) ⇒ Object
37 38 39 40 |
# File 'lib/fb_parse.rb', line 37 def self.get_id_feed(url) @id = url.split('/').last.split('?').first return @id end |
.get_id_photo_other(url) ⇒ Object
42 43 44 45 |
# File 'lib/fb_parse.rb', line 42 def self.get_id_photo_other(url) @id = url.split('/')[6] return @id end |
.get_id_photo_video(url) ⇒ Object
32 33 34 35 |
# File 'lib/fb_parse.rb', line 32 def self.get_id_photo_video(url) @id = url.split('/')[3].split('=')[1].split('&')[0] return @id end |
.get_id_status_link_checkin(url) ⇒ Object
27 28 29 30 |
# File 'lib/fb_parse.rb', line 27 def self.get_id_status_link_checkin(url) @id = url.split('/')[5].split('?')[0] return @id end |
.get_id_url(url) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/fb_parse.rb', line 17 def self.get_id_url(url) if url.include? 'photo' self.get_id_photo_video(url) elsif url.include? 'activity' self.get_id_feed else self.get_id_status_link_checkin(url) end end |