copiedbook 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4a0710063ebb2495a0fe49f9c18f3cb968a53c67
4
+ data.tar.gz: 79142720ce46774a60476d7035553df4ccffddc9
5
+ SHA512:
6
+ metadata.gz: 26b8eec97ff8f282176ce34c8d4870d47204d29ed18316ab734e9a3cd64ad993f8e3a03c669b60177f43372becbdc9615145254699ee78b9a5a9ac63bd9f3ece
7
+ data.tar.gz: 60a0947d32c56d3a20994d22e54a5e4702fa32a9f19ba2070c776f6f6463dc9a7b85ee4d30cffc18d2808352e8d479a08150b6d5e5673242738b34f6a4d4f6f2
@@ -0,0 +1,14 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ copiedbook (0.0.3)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+
10
+ PLATFORMS
11
+ ruby
12
+
13
+ DEPENDENCIES
14
+ copiedbook!
@@ -29,31 +29,33 @@ module Copiedbook
29
29
  end
30
30
 
31
31
  def main
32
- puts(" ---- STARTING ----\n\n")
32
+ puts("\n ---- STARTING COPIEDBOOK, GETTING POSTS ----\n\n")
33
33
 
34
34
  # Connect to Facebook and get the feed with all posts
35
35
  require 'koala'
36
36
  @graph = Koala::Facebook::API.new(@token)
37
37
  @output = []
38
-
39
38
  feed = get_feed
40
-
39
+
40
+ # Iterate through the feed to get all posts
41
41
  counter = 1
42
42
  until feed == nil
43
43
  @output += feed
44
- puts "We are in page #{counter} of the fanpage's feed"
44
+ puts " We are in page #{counter} of the fanpage's feed"
45
45
  counter += 1
46
46
  feed = get_next_page(feed)
47
47
  end
48
48
 
49
-
50
- # Iterate through the feed to get all comments
49
+ # Iterate through the posts to get all comments
50
+ puts "\n\n ---- COPIEDBOOK HAS FINISHED WITH POSTS, NOW GOING FOR COMMENTS ---- \n\n"
51
51
  @output.each_with_index do |post, index|
52
- if post["comments"]["count"] > 0
53
- puts " The post #{post["id"]} has #{post["comments"]["count"]} comments. We are going to retrieve them now."
52
+ if post["comments"]
54
53
  comments = []
55
54
  comment_feed = get_comment_feed(post)
55
+ counter = 1
56
56
  until comment_feed == nil
57
+ puts " Retrieving comments from post #{post["id"]} #{'(page '+counter.to_s + ')' if counter > 1}"
58
+ counter += 1
57
59
  comments += comment_feed
58
60
  comment_feed = get_next_page(comment_feed)
59
61
  end
@@ -65,7 +67,7 @@ module Copiedbook
65
67
  # Write the file
66
68
  File.open(@output_file, 'w') {|f| f.write(@output.to_json) }
67
69
 
68
- puts("\n\n ---- ENDING ----\n")
70
+ puts("\n\n ---- COPIEDBOOK HAS FINISHED ----\n")
69
71
  exit(0)
70
72
  end
71
73
 
@@ -1,3 +1,3 @@
1
1
  module Copiedbook
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copiedbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Markus Kuhnt
@@ -10,7 +9,7 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2013-07-05 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: Take a offline copy of a facebook fan page.
16
15
  email:
@@ -22,6 +21,7 @@ extra_rdoc_files: []
22
21
  files:
23
22
  - .gitignore
24
23
  - Gemfile
24
+ - Gemfile.lock
25
25
  - LICENSE.txt
26
26
  - README.md
27
27
  - Rakefile
@@ -33,26 +33,25 @@ files:
33
33
  - lib/copiedbook/version.rb
34
34
  homepage: http://www.tridoco.com
35
35
  licenses: []
36
+ metadata: {}
36
37
  post_install_message:
37
38
  rdoc_options: []
38
39
  require_paths:
39
40
  - lib
40
41
  required_ruby_version: !ruby/object:Gem::Requirement
41
- none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  required_rubygems_version: !ruby/object:Gem::Requirement
47
- none: false
48
47
  requirements:
49
- - - ! '>='
48
+ - - '>='
50
49
  - !ruby/object:Gem::Version
51
50
  version: '0'
52
51
  requirements: []
53
52
  rubyforge_project:
54
- rubygems_version: 1.8.23
53
+ rubygems_version: 2.0.3
55
54
  signing_key:
56
- specification_version: 3
55
+ specification_version: 4
57
56
  summary: Take a offline copy of a facebook fan page.
58
57
  test_files: []