fb_parse 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTIxMzAwNzY1Njk3OTE1MDVmNmM5YzFkZTMwOTRmOWIzZjQxOWIyZQ==
4
+ NGU3OGE3NGJkNGE4ODljZjVlOTM2N2I1Yjk4MDQyN2ZkYjhjNDA1NA==
5
5
  data.tar.gz: !binary |-
6
- N2FmMmFmMzNmNzNjMzE3ZWNlNjc1NTA1OWNhYjZmYzU5ZDJhNDNlMg==
6
+ MzI0Yjg3NTU0NGUwYjZjYjgzMmU4MTQwZjM4MzQzOTEyYjY1NWMxYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjA2OGFhYTY1Yjg4ZmMyYzU3ZGQ1OWZmMDJkM2ZkZGQzYThkYWY0NjEzZDlh
10
- MGI3ZmZkNzRlZDJjYjIxN2E5ZDI5ZTliNjQ0ZWM5NGE3ZGEzNGU0ZWY1MGI0
11
- NGFkNGM3ZWQzODg5OThlYzI0M2U4ZDI2MWUyYzk5ZGU3MTNjNzk=
9
+ YmY0YzcxMTQ0MmYwNGI4YThiMDEwYmExZTQxN2M1MTVkOTg4MjFiYjE1OGVi
10
+ NDNiYjA4Yzc2MTM4ZWZhYjg4ZjgzNGEwNTQ5YmM5MzJlZDgyZjZmNDI5NjRl
11
+ OWFhMTI5ZDE3MDAxNTI5ZTM5YzExN2IxNjhjOWQ2ODQ3ZWYyYWI=
12
12
  data.tar.gz: !binary |-
13
- YjMzZjQ0ZWU1N2RlYzdhMTBhYTI1ZDRjNDI3NjQ4NDRjMjVjYTQxMGE2M2Mx
14
- YmM0YTZkYzhmYmY4ZDIzYmU0OWVhNzNiNzBmYmNiZmM2ZTYwZGI1YmFkMTE3
15
- ZjcyZTQ3MmVhZmRlZjFkMGNiMGE1NjdjZTlmZjhjMjJkMGI1NGM=
13
+ MzI1MDEzY2M5ODMyYzczMGE3M2U0NmRkZTQ3YmYyYWM5NDVhNDNkODczNjUz
14
+ YzQyNWFmMGE4Y2VjZmQwNjUxNTkzOTcwM2I3YmI5ZjFjN2ZjMjI3YzY0OThl
15
+ MzEwNWRmYjBmZTRlM2U2MzIyOTU1ZTgwMmYzZGI3ODBiNWRhYmM=
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Ruby Gem to parse an ID from various Facebook URLs
4
4
 
5
+ Requires getting the URL from a specific place, not really acceptable for end user use but is functional enough to provide in a CMSas you can directly instruct end user.
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -18,7 +20,13 @@ Or install it yourself as:
18
20
 
19
21
  ## Usage
20
22
 
21
- TODO: Write usage instructions here
23
+ To return an ID, run FbParse.get_id(url), where url is taken from the address bar on the individual link page.
24
+
25
+ How to get a correctly formatted URL:
26
+
27
+ 1. Find post on Facebook
28
+ 2. Click on the date link on the post
29
+ 3. Copy URL from your address bar
22
30
 
23
31
  ## Contributing
24
32
 
@@ -1,3 +1,3 @@
1
1
  module FbParse
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/fb_parse.rb CHANGED
@@ -3,18 +3,18 @@ require "fb_parse/version"
3
3
  module FbParse
4
4
  def self.get_id(url)
5
5
  if url.include? 'photo'
6
- get_id_status_link_checkin(url)
6
+ self.get_id_photo_video(url)
7
7
  else
8
- get_id_photo_video(url)
8
+ self.get_id_status_link_checkin(url)
9
9
  end
10
10
  end
11
11
 
12
- def get_id_status_link_checkin(url)
12
+ def self.get_id_status_link_checkin(url)
13
13
  @id = url.split('/')[5].split('?')[0]
14
14
  return @id
15
15
  end
16
16
 
17
- def get_id_photo_video(url)
17
+ def self.get_id_photo_video(url)
18
18
  @id = url.split('/')[3].split('=')[1].split('&')[0]
19
19
  return @id
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb_parse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Imaan Minaii