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 +8 -8
- data/README.md +9 -1
- data/lib/fb_parse/version.rb +1 -1
- data/lib/fb_parse.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NGU3OGE3NGJkNGE4ODljZjVlOTM2N2I1Yjk4MDQyN2ZkYjhjNDA1NA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MzI0Yjg3NTU0NGUwYjZjYjgzMmU4MTQwZjM4MzQzOTEyYjY1NWMxYQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YmY0YzcxMTQ0MmYwNGI4YThiMDEwYmExZTQxN2M1MTVkOTg4MjFiYjE1OGVi
|
|
10
|
+
NDNiYjA4Yzc2MTM4ZWZhYjg4ZjgzNGEwNTQ5YmM5MzJlZDgyZjZmNDI5NjRl
|
|
11
|
+
OWFhMTI5ZDE3MDAxNTI5ZTM5YzExN2IxNjhjOWQ2ODQ3ZWYyYWI=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
|
data/lib/fb_parse/version.rb
CHANGED
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
|
-
|
|
6
|
+
self.get_id_photo_video(url)
|
|
7
7
|
else
|
|
8
|
-
|
|
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
|