googleplus_markdown 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/googleplus_markdown.rb +27 -29
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea648bfdba16c2ceaaccfded78691de275de3540
4
- data.tar.gz: 0c23ff31e96f7dcb388a514e9828510ab1cb083e
3
+ metadata.gz: a086f570759bcbf2c861786142a740c0bfc7199d
4
+ data.tar.gz: 3bb8a832dd19afb1ae101cf888f6d7c0f8e80e01
5
5
  SHA512:
6
- metadata.gz: da56817bee8f502e62f941cec0da02408b5dc9c7b0ba296cafe8532f5c5048dc9842ee1dae76fcd147953bfd6411fcead7ffc2796800f42c5ecd6f3a9cb32021
7
- data.tar.gz: 27e00145f4e855c3f8fad04e202ffce8f9cd7cbb13808183972d06656d0c41359a2fc77f9524bbbb05c7d375106468e68cdf57d731ce55b431ffa984299f70c2
6
+ metadata.gz: 8f233df432f7be94a08f86f0c703ce3b9419e3e2f219a06df76237fc046242ae1d3edaf50fc2c873efb17cc5fc3555c2fe7eeb8252042bf3d8a766c45d865d26
7
+ data.tar.gz: 99ddd43456e76f9d21a11d74208404b6de117681c6964071a0db69300aaf3a3254169cf9a9b9cc0c65af305ac4c2bd14d773377727a846ec0e874bd161fc1112
@@ -9,36 +9,34 @@ require 'json'
9
9
  class GooglePlusMarkdown
10
10
 
11
11
  def convert(data)
12
- unless data['verb'] == "share" || data['access']['accessSummary'] == "Shared privately"
13
- # Let's declare the output string.
14
- markdown = ""
15
-
16
- # I need the creation date so I can set the file name.
17
- # Of course, Google can't just call it a 'created' date.
18
- date_created = data['published']
19
- file_name = "#{date_created}.md"
20
-
21
- # Instead of doing multiple writes to a file, I'm going to
22
- # build a string that I can pass around to various functions.
23
- # When I'm done, I'll write *that* to the file.
24
- markdown.concat(generate_front_matter(data))
25
-
26
- # I'm getting the raw text of the post, with Google+'s half-assed
27
- # implementation of Textile for markup.
28
- markdown.concat("#{retrieve_post_content(data)}\n\n")
29
-
30
- # Let's get some photos tacked onto the end, shall we?
31
- markdown.concat("#{attach_images(data)}\n")
32
-
33
- # If anybody replied to these posts, let's retrieve the replies
34
- # and tack them onto the end. Some of them are actually worth a damn.
35
- replies = data['object']['replies']['items']
36
- unless(replies == nil)
37
- markdown.concat("#{retrieve_replies(replies)}")
38
- end
12
+ # Let's declare the output string.
13
+ markdown = ""
14
+
15
+ # I need the creation date so I can set the file name.
16
+ # Of course, Google can't just call it a 'created' date.
17
+ date_created = data['published']
18
+ file_name = "#{date_created}.md"
19
+
20
+ # Instead of doing multiple writes to a file, I'm going to
21
+ # build a string that I can pass around to various functions.
22
+ # When I'm done, I'll write *that* to the file.
23
+ markdown.concat(generate_front_matter(data))
24
+
25
+ # I'm getting the raw text of the post, with Google+'s half-assed
26
+ # implementation of Textile for markup.
27
+ markdown.concat("#{retrieve_post_content(data)}\n\n")
28
+
29
+ # Let's get some photos tacked onto the end, shall we?
30
+ markdown.concat("#{attach_images(data)}\n")
39
31
 
40
- handle_file_io(markdown, file_name)
32
+ # If anybody replied to these posts, let's retrieve the replies
33
+ # and tack them onto the end. Some of them are actually worth a damn.
34
+ replies = data['object']['replies']['items']
35
+ unless(replies == nil)
36
+ markdown.concat("#{retrieve_replies(replies)}")
41
37
  end
38
+
39
+ handle_file_io(markdown, file_name)
42
40
  end
43
41
 
44
42
  private
@@ -153,7 +151,7 @@ class GooglePlusMarkdown
153
151
 
154
152
  def retrieve_post_content(data)
155
153
  post_content = data['object']['originalContent']
156
-
154
+
157
155
  attachment = Hash.new
158
156
  unless data['object']['attachments'] == nil
159
157
  attachment = data['object']['attachments'][0]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: googleplus_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Graybosch