directlink 0.0.4.0 → 0.0.4.1

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: 31d4684edbeadeddce540e3ca0a1894f5756af86
4
- data.tar.gz: f1efd18489faf49d2bc7460f210b53cf7cb0929c
3
+ metadata.gz: 7a07a4e3fb181e173d60d07dfa59aeb271d96465
4
+ data.tar.gz: 0e8903a3ae585b36bccca7830f4344fbbf642b3a
5
5
  SHA512:
6
- metadata.gz: bef3ef81ba91007a8b26d6f45813d67319bd00b3c3bfbc71977d2caa4c40e29f31e8f35a32d2f7af8c1c8bcd8d7a267ef3998bc51912a997462a864f2cf563e0
7
- data.tar.gz: 18f45737947862ebc5409b3a20be5d2389aa7e9f85125bd85465c670c7ab488b43ab55c599ac79bdfde7063125b5a891a42336f9c2348ffcd5807707dc908d44
6
+ metadata.gz: b623472083860ac4b05f4ed972c3c6aa8cf3c7f8909930b001eeb183c5e480977afe2df8868ec86b82f9e7f0055a2d7c8dee711226781675c5fef4fab74d0007
7
+ data.tar.gz: 6ea8634f8953a26d98e01a285528ef11c67b21e4ca4efad13dca031b47a002161a02152cc203200edfdf1babecb5cb5667fd2f53345b18eb641113b26f4592c1
data/README.md CHANGED
@@ -91,7 +91,7 @@ $ export FLICKR_API_KEY=dc2bfd348b...
91
91
 
92
92
  If the passed link is not the image link or a photo page of a known image hosting, the tool is still able to find the main images that the linked webpage contains (here it found three images in the markdown file):
93
93
  ```
94
- $ bundle exec bin/directlink https://github.com/Nakilon/dhash-vips
94
+ $ directlink https://github.com/Nakilon/dhash-vips
95
95
  <= https://github.com/Nakilon/dhash-vips
96
96
  => https://camo.githubusercontent.com/852607c7f4b604fc3c83b782c4f6983cf488b0d4/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f64686173682d766970732e6e616b696c6f6e2e70726f2f64686173685f69737375655f6578616d706c652e706e67
97
97
  png 592x366
data/directlink.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "directlink"
3
- spec.version = "0.0.4.0"
3
+ spec.version = "0.0.4.1"
4
4
  spec.summary = "converts any kind of image hyperlink to direct link, type of image and its resolution"
5
5
 
6
6
  spec.author = "Victor Maslov aka Nakilon"
data/lib/directlink.rb CHANGED
@@ -199,7 +199,6 @@ module DirectLink
199
199
  imageinfo.first["url"]
200
200
  end
201
201
 
202
-
203
202
  class_variable_set :@@directlink, Struct.new(:url, :width, :height, :type)
204
203
  end
205
204
 
@@ -305,7 +304,7 @@ def DirectLink link, max_redirect_resolving_retry_delay = nil, giveup = false
305
304
  end
306
305
  l[html].group_by(&:first).map{ |k, v| [k.join(?>), v.map(&:last)] }.tap do |result|
307
306
  next unless result.empty?
308
- raise unless t = html.at_css "meta[@property='og:image']"
307
+ raise unless t = html.at_css("meta[@property='og:image']")
309
308
  return DirectLink t[:content], nil, true
310
309
  end.max_by{ |_, v| v.map{ |i| i.width * i.height }.inject(:+) / v.size }.last
311
310
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: directlink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.0
4
+ version: 0.0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov aka Nakilon