uscis_status 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Yjk3MTY1YTcyNTQ0ZmNjZTVkMjYwOWQ3MjVjYjMxZTEzNTliMjE5NQ==
4
+ NzU0YjVlM2MyYmIzNmI0ZTg0OWM4YWNiYzg2NjVjNjBmMWQ3MmVlYw==
5
5
  data.tar.gz: !binary |-
6
- M2FiZjZiOWE0OWVlYWRmNDM4YWJlMWY3YmIxNzY5MDBhOTY5OTc0ZA==
6
+ Mzc2ZDlhMzEyZGEwZWM0M2RlMDhjNzc2MjdhNWY0ZmU5ZjFhZTE2ZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWZhY2RkOWIyMDI4ZTkyMjZmMTBlODdiNGQ3NjE4MzI2N2U0ZTg4ZGZlNGEx
10
- NTQ0NTg1ZDczMjA1NWM5YWYzMmE3OTg1MDQ4NTllZWIxMjZmM2RmODZiMjUy
11
- M2I5NmU1MTcyNzJhNmU1M2QwZTM5YzVmOTQ4NjY4MTBkOGRmN2E=
9
+ ZThlYzQxNzFlMTZlYmNlYjkwMTdhYjQxOGE4NjUyN2I3YTZhMmQxOTExOGE4
10
+ NmUzYjkxZmU3NDgwNTQyMTU0Njg5MjZhYTIzOTMzMjFmZTg0ZTY1YTdlMWE1
11
+ NGQ2MGY0MzA5MzM4OTIzZGZkYTZmZTJkZWM0NWJhYWQ4ZjA2OTk=
12
12
  data.tar.gz: !binary |-
13
- MGIzM2IyZjIwMTY5NDQ0MTc3Y2Q5NWNmOGM3OWQ2NTliMjM2ZGM5ZGZkNDU4
14
- ZDZlMDc2ZDZjYThkZDIzOWU0MWVlODRiMzZjYzc5MDQ5N2Y4NjgyNTZhZWFi
15
- MjZjMjc1YjE4ZTcyYmI5MTg4YzJmMjcwZjRkZGJlNjc5MGNjN2I=
13
+ ZTY5NTcxNjU4YjE0YzAwMjViZWQxMTE4Nzk0NzA3YmU2MTZkOTI3MmM2ZDlj
14
+ ZTY3OTJmN2Y3ZDI4ODhhMmI1NzFkNTI1OTM5MWYzODc2NjlhMjVjNTExNTNi
15
+ OTkzYjFlZWZlYzQ4ZjA3MDMyYzU1Y2JmNzRmM2I5ZDI1NGEwMDA=
data/README.md CHANGED
@@ -1,12 +1,17 @@
1
- # USCIS Status Checker
1
+ # USCIS Status Checker Gem
2
2
 
3
- Easy way to check multiple application statuses from USCIS website.
3
+ This gem makes it easy to check multiple application statuses from USCIS website, without visiting the USCIS website.
4
4
 
5
5
  ## Important
6
6
 
7
7
  This is not the official way to check the status of a USCIS application and it's not endorsed by USCIS either.
8
8
  It's just a scraper of the USCIS website and it may break at any time if the website is updated. If it should happen, feel free to report me or to [fix](#contributing) the problem.
9
9
 
10
+ ## Live Example
11
+
12
+ Take a look at the 'Multiple USCIS Status Checker' website that uses this gem:
13
+
14
+ [http://uscisstatus.herokuapp.com](http://uscisstatus.herokuapp.com)
10
15
 
11
16
  ## Installation
12
17
 
@@ -16,7 +21,7 @@ Add this line to your application's Gemfile:
16
21
 
17
22
  And then execute:
18
23
 
19
- $ bundle
24
+ $ bundle install
20
25
 
21
26
  Or install it yourself as:
22
27
 
@@ -1,3 +1,3 @@
1
1
  module USCISStatus
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
data/lib/uscis_status.rb CHANGED
@@ -20,26 +20,26 @@ module USCISStatus
20
20
  page = mechanize.post("https://egov.uscis.gov/cris/Dashboard/CaseStatus.do", { "appReceiptNum" => number })
21
21
 
22
22
  # Look for possible errors with this application number
23
- error = page.search('div.errorContainer > ul')
23
+ error = page.search('.//div[@class="errorContainer"]/ul')
24
24
  if !error.empty?
25
25
  statuses << {number: number, type: 'NONE', status: error.text.strip, description: '', general_description: ''}
26
26
  next
27
27
  end
28
28
 
29
29
  # Get the application type and description (eg. Form I130...)
30
- application_type = capitalize_words(page.search('div#caseStatus>h3').text.gsub(CURRENT_CASE, ""))
30
+ application_type = capitalize_words(page.search('.//div[@id="caseStatus"]/h3').text.gsub(CURRENT_CASE, ""))
31
31
 
32
32
  # Get current application block
33
- current_application = page.search('div.caseStatusInfo')
33
+ current_application = page.search('.//div[@class="caseStatusInfo"]')
34
34
 
35
35
  # Get the Status
36
- status = current_application.search('h4').text.strip
36
+ status = current_application.search('.//h4').text.strip
37
37
 
38
38
  # Get the Description
39
- description = current_application.search('.caseStatus').text.strip
39
+ description = current_application.search('.//p[@class="caseStatus"]').text.strip
40
40
 
41
41
  # Get the General Description for the Application
42
- general_description = current_application.search('#bucketDesc').text.strip
42
+ general_description = current_application.search('.//div[@id="bucketDesc"]').text.strip
43
43
 
44
44
  statuses << {number: number, type: application_type, status: status, description: description, general_description: general_description}
45
45
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uscis_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillermo Guerini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-26 00:00:00.000000000 Z
11
+ date: 2013-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler