socializer-scraper 0.0.3 → 0.0.4

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: dca36b51da99ac68ef2d7f6dc62fb48c46ee015b
4
- data.tar.gz: 03e55384ed88979807a2bddc02acd02082b31d82
3
+ metadata.gz: 5ff0568774a1e3bf2ce45ffee204ad10802906ab
4
+ data.tar.gz: 964535e1f772af5f02ab1b029cb3a9281251d5c1
5
5
  SHA512:
6
- metadata.gz: e07091135c2fbdafe8626dea0145119522cc2262df87459fa95b526c89f91a78d046d2a868cd853a69f4c72b487aa89e07473346b15f2e0bfab907a94f4a92b2
7
- data.tar.gz: fa6185bc3d4700f4b65317cbc94f328b7cd27d8312c5622d8d2a5f21212dede0a6a341fc86df699d2f4845b0043719e7659399595163d0f9a54825866e783ec1
6
+ metadata.gz: 1dbebe4c40d48807ef2675b856aa4c47d5436cf45134c429a34bc6c9451506dbe7ed28a26ec43ffcce096d833868b5fcc44b827274f7141c15551544b4b0bc9c
7
+ data.tar.gz: 31ae5ac34fc0ecb904468772e6e7d2d51286b286a42c86740ee3095688e90471f1a3b97f08787ddffb9b22794b64b447bbc514e5c1fdd4ba6d107a702c56094c
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require 'pry'
3
4
  require 'yaml'
4
5
  require 'thor'
5
6
  require 'fileutils'
@@ -17,10 +18,11 @@ class Socializer::Scraper::CLI < Thor
17
18
  puts "Scraping website: #{website}"
18
19
  puts "=" * 100
19
20
 
20
- file = File.join(Dir.pwd, "#{website}.yml")
21
+ website = URI.parse("http://#{website}") unless website.start_with?("http")
22
+ file = File.join(Dir.pwd, "#{website.host}.yml")
21
23
  counter, list = 0, (File.exists?(file) ? YAML.load_file(file) : [])
22
24
 
23
- extractor.url = "http://" + website unless website.start_with?("http")
25
+ extractor.url = website.to_s
24
26
  extractor.run do |page, collector, found|
25
27
  found = found.map{ |email| email.strip }.accumulate - list
26
28
  list |= found
@@ -1,5 +1,5 @@
1
1
  module Socializer
2
2
  module Scraper
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socializer-scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikhil Gupta