email_list_verify 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0fc15dee0e34523a0bb841ab3d02efba5d3ca047
4
+ data.tar.gz: 921a9228bc5720b73b202460f94710c26904540d
5
+ SHA512:
6
+ metadata.gz: b9c6daa97032a79c490e53a9982f23dcf467088a86fdb66f3388a2a89c6c2c3a98b286f768b24cd1c9134bdadb5ebdd4dcae74e024ee110ff86261bfd047e92f
7
+ data.tar.gz: 8a27f296126e0e67f4adad7e82c67a1169436ba84a5aa825900dcab3056c15e5b917f54ba9e60e1dc00172c4f4023e38a20fe89b51fe56102e5ec5869977faa2
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .idea
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in email_list_verify.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Ankur Singh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # EmailListVerify
2
+
3
+ A ruby gem wrapper for the EmailListVerify.com API.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'email_list_verify'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install email_list_verify
20
+
21
+ ## Usage
22
+
23
+ To use the gem, first include email_list_verify
24
+ require 'email_list_verify'
25
+
26
+ Then create an instance of the EmailListVerify with api_key as the parameter
27
+ ```ruby
28
+ api_key = "<YOUR_API_KEY>"
29
+ client = EmailListVerify.new(api_key)
30
+ ```
31
+
32
+ Now the API calls can be done via the client
33
+
34
+ ### For OneByOne Verification
35
+
36
+ client.one_by_one("<email_to_verify>")
37
+
38
+ ### To Upload a Bulk File
39
+
40
+ client.upload_file("<file_name>","<path/to/file>")
41
+
42
+ path/to/file is optional if file_name file is present in same directory
43
+
44
+ ### To get the status of the last uploaded file
45
+
46
+ client.bulk_status
47
+
48
+ ### To get the status of any file with file_id
49
+
50
+ client.bulk_status("<file_id>")
51
+
52
+ ## Example
53
+
54
+ Create a client
55
+
56
+ client = EmailListVerify.new("<api_key>")
57
+
58
+ Verify Single Email
59
+
60
+ client.one_by_one("ankur13019@iiitd.ac.in")
61
+ # ok
62
+
63
+ Upload a bulk verify file
64
+
65
+ client.upload_file("emails.txt")
66
+ # 1234
67
+
68
+ Check the status of last uploaded file
69
+
70
+ client.bulk_status
71
+ # 123456|1234_clean.csv|no|0|0|new|1456521414||
72
+
73
+ Check the status of previously uploaded file
74
+
75
+ client.bulk_status(1233)
76
+ # 123455|1233_clean.csv|no|2|2|finished|1456521414|<url_to_result_ok.csv>|<url_to_all_results.csv
77
+
78
+ ## Development
79
+
80
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
81
+
82
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
83
+
84
+ ## Contributing
85
+
86
+ Bug reports and pull requests are welcome on GitHub at https://github.com/rush-skills/email_list_verify. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
87
+
88
+ ## License
89
+
90
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
91
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "email_list_verify"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'email_list_verify/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "email_list_verify"
8
+ spec.version = EmailListVerify::VERSION
9
+ spec.authors = ["Ankur Singh"]
10
+ spec.email = ["ankur13019@iiitd.ac.in"]
11
+
12
+ spec.summary = "Ruby wrapper for the EmailListVerify.com API"
13
+ spec.description = "Provides a ruby wrapper for the OneByOne, FileUpload and FileStatus APIs."
14
+ spec.homepage = "https://github.com/rush-skills/email_list_verify"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_development_dependency "bundler", "~> 1.11"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ spec.add_runtime_dependency 'rest-client', '~> 1.8'
31
+ end
@@ -0,0 +1,37 @@
1
+ require "email_list_verify/version"
2
+
3
+ require 'rest-client'
4
+ class EmailListVerify
5
+ BASE = 'https://app.emaillistverify.com/api'
6
+ ONE_BY_ONE_PATH = BASE + "/verifEmail"
7
+ UPLOAD_FILE_PATH = BASE + "/verifApiFile"
8
+ FILE_INFO_PATH = BASE + "/getApiFileInfo"
9
+ BULK_ERRORS = ["no_credit","cannot_upload_file","key_not_valid","missing_parameters"]
10
+
11
+ def initialize(api_key)
12
+ @api_key = api_key
13
+ end
14
+ def one_by_one(email)
15
+ options = {params: {email: email, secret: @api_key}}
16
+ RestClient.get(ONE_BY_ONE_PATH, options)
17
+ end
18
+ def upload_file(file_name, file_path=nil)
19
+ file_path ||= file_name
20
+ options = {file_contents: File.new(file_path)}
21
+ url = UPLOAD_FILE_PATH+"?secret=#{@api_key}&filename=#{file_name}"
22
+ res = RestClient.post(url, options)
23
+ unless BULK_ERRORS.include? (res.to_s)
24
+ @id = res
25
+ end
26
+ res
27
+ end
28
+ def bulk_status(file_id=nil)
29
+ unless file_id or @id
30
+ return "Please provide the file_id or call the upload_file with a success"
31
+ end
32
+ id = file_id
33
+ id ||= @id
34
+ options = {params: {id: id, secret: @api_key}}
35
+ RestClient.get(FILE_INFO_PATH, options)
36
+ end
37
+ end
@@ -0,0 +1,3 @@
1
+ class EmailListVerify
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: email_list_verify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ankur Singh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-02-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rest-client
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.8'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.8'
55
+ description: Provides a ruby wrapper for the OneByOne, FileUpload and FileStatus APIs.
56
+ email:
57
+ - ankur13019@iiitd.ac.in
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - bin/console
68
+ - bin/setup
69
+ - email_list_verify.gemspec
70
+ - lib/email_list_verify.rb
71
+ - lib/email_list_verify/version.rb
72
+ homepage: https://github.com/rush-skills/email_list_verify
73
+ licenses:
74
+ - MIT
75
+ metadata:
76
+ allowed_push_host: https://rubygems.org
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.4.8
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Ruby wrapper for the EmailListVerify.com API
97
+ test_files: []