nokaya 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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +25 -1
- data/lib/nokaya/app.rb +28 -1
- data/lib/nokaya/getter.rb +4 -1
- data/lib/nokaya/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfaaca59bb32617d0aaa5baaf5719bce56af6540
|
4
|
+
data.tar.gz: e3113b039ae77a8b2264de0fa4c6db5e984f736e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9531657d52de1ccac200303bad7b04ea4e12ee4a67560695076437e9f3b6e38e776aa5cca3221412e0e517a3d6ad00b3bce90a7514e10892820752ef081f1026
|
7
|
+
data.tar.gz: 08eba800eb512b34ee36048207d27de4d99e60e84d73369c5b136e37819d275583b0dab763f7bff9831e69f6a7914190e4cf67fd2e7abf139cb9c0a8f095a9ee
|
data/CHANGELOG.md
CHANGED
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`
|
data/lib/nokaya/app.rb
CHANGED
@@ -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.
|
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
|
data/lib/nokaya/getter.rb
CHANGED
@@ -23,9 +23,12 @@ module Nokaya
|
|
23
23
|
abort Status.no_can_do
|
24
24
|
end
|
25
25
|
end
|
26
|
-
def
|
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
|
data/lib/nokaya/version.rb
CHANGED