nokaya 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a437d53d827e0c39fa5c65dddd1c0920178f82c
4
- data.tar.gz: f017ad65a6324f89a17d0629a4061c6a8fe5b10b
3
+ metadata.gz: bfaaca59bb32617d0aaa5baaf5719bce56af6540
4
+ data.tar.gz: e3113b039ae77a8b2264de0fa4c6db5e984f736e
5
5
  SHA512:
6
- metadata.gz: b2399328cb080b8604ed821b31db036c355b0492a32cb7a9ad0185012a8338d8e5f45b11aaeb59922a1284d6458e1315c07663b7310374319feba6f8bb2c541e
7
- data.tar.gz: d9ab1abe1fc57243c56e95b587184a136beb6053ccb00476e3eeac7e7fcecaf972c35b1ce5c5d6e627148c4efe58843e1dfd1818e74fbfbff03cfabd528b3cea
6
+ metadata.gz: 9531657d52de1ccac200303bad7b04ea4e12ee4a67560695076437e9f3b6e38e776aa5cca3221412e0e517a3d6ad00b3bce90a7514e10892820752ef081f1026
7
+ data.tar.gz: 08eba800eb512b34ee36048207d27de4d99e60e84d73369c5b136e37819d275583b0dab763f7bff9831e69f6a7914190e4cf67fd2e7abf139cb9c0a8f095a9ee
@@ -1,3 +1,8 @@
1
+ # 0.0.3
2
+
3
+ - Favd
4
+ - photos.app.net
5
+
1
6
  # 0.0.2
2
7
 
3
8
  - Error messages
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nokaya
2
2
 
3
- CLI to download photos from several online services including Instagram.
3
+ CLI to download photos from several online services including Instagram, App.net and Favd.
4
4
 
5
5
  Mac OS X only for the time being.
6
6
 
@@ -21,3 +21,27 @@ Example:
21
21
  `nokaya -i http://instagram.com/p/noANAfjJ7B/`
22
22
 
23
23
  `nokaya -i http://instagram.com/p/noANAfjJ7B/ -n happydog`
24
+
25
+ ### Favd
26
+
27
+ `nokaya favd url`
28
+
29
+ `nokaya favd url -n file_name`
30
+
31
+ Example:
32
+
33
+ `nokaya favd http://pic.favd.net/29987710`
34
+
35
+ `nokaya favd http://pic.favd.net/29987710 -n feet`
36
+
37
+ ### App.net
38
+
39
+ `nokaya adn url`
40
+
41
+ `nokaya adn url -n file_name`
42
+
43
+ Example:
44
+
45
+ `nokaya adn https://photos.app.net/30055986/1`
46
+
47
+ `nokaya adn https://photos.app.net/30055986/1 -n random`
@@ -13,11 +13,38 @@ module Nokaya
13
13
  abort Status.no_url if args.empty?
14
14
  nokaya = Getter.new options, :instagram, args
15
15
  page = nokaya.parse_page
16
- img_link = nokaya.get_link page
16
+ img_link = nokaya.get_basic page
17
+ download_and_save img_link, nokaya
18
+ end
19
+
20
+ desc "favd", 'Get the photo from a Favd page (nokaya favd url)'
21
+ option :name, aliases: "-n", type: :string, desc: "Specify a file name without extension"
22
+ def favd *args
23
+ abort Status.no_url if args.empty?
24
+ nokaya = Getter.new options, :favd, args
25
+ page = nokaya.parse_page
26
+ img_link = nokaya.get_favd page
27
+ download_and_save img_link, nokaya
28
+ end
29
+
30
+ desc "adn", "Get the photo from a photos.app.net page (nokaya adn url)"
31
+ option :name, aliases: "-n", type: :string, desc: "Specify a file name without extension"
32
+ def adn *args
33
+ abort Status.no_url if args.empty?
34
+ nokaya = Getter.new options, :adn, args
35
+ page = nokaya.parse_page
36
+ img_link = nokaya.get_basic page
37
+ download_and_save img_link, nokaya
38
+ end
39
+
40
+ private
41
+
42
+ def download_and_save img_link, nokaya
17
43
  puts Status.downloading img_link
18
44
  path = Image.photo_name nokaya
19
45
  Image.save_image(path, nokaya.get_image(img_link))
20
46
  puts Status.saved path
21
47
  end
48
+
22
49
  end
23
50
  end
@@ -23,9 +23,12 @@ module Nokaya
23
23
  abort Status.no_can_do
24
24
  end
25
25
  end
26
- def get_link page
26
+ def get_basic page
27
27
  page.xpath("//meta[@property='og:image']/@content").first
28
28
  end
29
+ def get_favd page
30
+ page.css('#largeImage')[0]['src']
31
+ end
29
32
  def parse_page
30
33
  Nokogiri::HTML get_page_content
31
34
  end
@@ -1,3 +1,3 @@
1
1
  module Nokaya
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokaya
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
  - Eric Dejonckheere