secondHandler 0.0.1 → 0.0.2

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa557d8ac82cab551490e67dce3783c3b06c61c2
4
- data.tar.gz: e99a38ee0883b0c79801966b70fe72f58b0de951
3
+ metadata.gz: dff04350f7ea7c765fdf215e85a81d593f6995a7
4
+ data.tar.gz: aefc098794f4d5c1d1e3de37cac030d41033550f
5
5
  SHA512:
6
- metadata.gz: f2f46d0c7a0295d5086cca62927045ec3e93582d0d2aca0ad8b71073252026b56a07db18e279097f47327cdd08e38000e63b598dc252230b2f1d80ae1e60f00d
7
- data.tar.gz: fd3abf3fb98bcd071f78a6692d1ebfe10dcab1d5d2853e1deaf05c2d917b407c6e3ed5d3e9ae6705c49a2d76a8129693a0cb9561dfc74771698cdc320a0b3dbe
6
+ metadata.gz: bf596f8daec02216bd139e15c82570c47dd5ac666a8a1cc80666fec849b1f31f360813913965e8e42e3bb6ffb84f3fd75e39764c4d421d4bd5b0e7e2c675aefa
7
+ data.tar.gz: 0047c71ca2bd3cc9ae68566231039e3c3df1de0f7291bfa20ff82db94d2190f3f5f92aa969e89fd1fca0c9f836979064615bf6c1c635e77b446e9fd0dda9fc10
data/README.md CHANGED
@@ -1,8 +1,32 @@
1
- SecondHand-ler
1
+ SecondHandler[![Gem Version](https://badge.fury.io/rb/secondHandler.svg)](https://badge.fury.io/rb/secondHandler)
2
2
  ==
3
3
 
4
4
  ## Description
5
- SecondHand-ler is a retriever for second-hand groups.
5
+ SecondHandler is a retriever for second-hand information on Twitter and Facebook.
6
+
7
+ Usage
8
+ ==
9
+ **install**
10
+ ```shell
11
+ gem install secondHandler
12
+ ```
13
+ **CLI**
14
+ Tips: You can use :arrow_down: & :arrow_up: arrow key to fetch next/previous page.
15
+ `Ctrl + C` to exit!
16
+ ```shell
17
+ $ second_handler fb --token 'facebook_dev_access_token' --id 'public_group_id'
18
+ ```
19
+ **Code Snippet**
20
+ ```ruby
21
+ require 'second_handler'
22
+ fb = SecondHandler::FbGroupPost.new('access_token', 'group_id')
23
+ # fetch first page
24
+ page = fb.first_page
25
+ # get neat content
26
+ content = page.get_content
27
+ # get next page
28
+ page = page.next_page
29
+ ```
6
30
 
7
31
  ## License
8
32
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ #!/usr/bin/env ruby
2
3
  require 'rubygems'
3
4
  require 'commander'
4
5
  require_relative '../lib/second_handler'
@@ -37,11 +37,12 @@ module SecondHandler
37
37
 
38
38
  def attachment_helper (attach_hash)
39
39
  ok_data = []
40
+
40
41
  if attach_hash && attach_hash["data"].first["media"]
41
42
  ok_data << attach_hash["data"].first["media"]
42
43
  end
43
- if attach_hash && attach_hash["data"].first["subattachments"]
44
- attach_hash["data"].first["subattachments"].each do |item|
44
+ if attach_hash && attach_hash["data"].first["subattachments"] && attach_hash["data"].first["subattachments"]["data"]
45
+ attach_hash["data"].first["subattachments"]["data"].each do |item|
45
46
  ok_data << item
46
47
  end
47
48
  end
@@ -1,4 +1,4 @@
1
1
  module SecondHandler
2
- VERSION = '0.0.1'
3
- DATE = '2015-10-24'
4
- end
2
+ VERSION = '0.0.2'
3
+ DATE = '2015-10-25'
4
+ end
@@ -6,11 +6,11 @@ Gem::Specification.new do |s|
6
6
  s.date = SecondHandler::DATE
7
7
  s.executables << 'second_handler'
8
8
  s.summary = ''
9
- s.description = 'SecondHand-ler is a retriever for second-hand information of Twitter and Facebook'
9
+ s.description = ''
10
10
  s.authors = ['Sheng Jung Wu', 'Calvin Jeng', 'Henry Chang', 'Yi Wei Huang']
11
11
  s.files = `git ls-files`.split("\n")
12
12
  s.test_files = `git ls-files spec/*`.split("\n")
13
- s.homepage = 'https://github.com/Smartibuy/SecondHand-ler'
13
+ s.homepage = 'https://github.com/Smartibuy/ideate-and-scrape'
14
14
  s.license = 'MIT'
15
15
 
16
16
  # depend gem
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secondHandler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheng Jung Wu
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-10-24 00:00:00.000000000 Z
14
+ date: 2015-10-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: minitest
@@ -55,8 +55,7 @@ dependencies:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
- description: SecondHand-ler is a retriever for second-hand information of Twitter
59
- and Facebook
58
+ description: ''
60
59
  email:
61
60
  executables:
62
61
  - second_handler
@@ -72,7 +71,7 @@ files:
72
71
  - lib/second_handler/version.rb
73
72
  - secondhandler.gemspec
74
73
  - spec/second_handler_spec.rb
75
- homepage: https://github.com/Smartibuy/SecondHand-ler
74
+ homepage: https://github.com/Smartibuy/ideate-and-scrape
76
75
  licenses:
77
76
  - MIT
78
77
  metadata: {}
@@ -92,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
91
  version: '0'
93
92
  requirements: []
94
93
  rubyforge_project:
95
- rubygems_version: 2.4.5.1
94
+ rubygems_version: 2.4.6
96
95
  signing_key:
97
96
  specification_version: 4
98
97
  summary: ''