-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.rb
More file actions
37 lines (28 loc) · 784 Bytes
/
Copy pathparse.rb
File metadata and controls
37 lines (28 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'rubygems'
require 'net/http'
require 'json'
require 'pp'
=begin
uri = "http://www.odesk.com/api/profiles/v1/search/jobs.json?page=1;10";
html = Net::HTTP.get_response(URI.parse(uri)).body
File.open('cache.html','w') { |file| file.puts html }
=end
f = File.open('cache.html','r')
html = ""
f.each_line do |line|
html += line
end
json = JSON.parse(html)
for key, value in json
p key
end
jobs = json['jobs']['job']
for key, value in json['jobs']['job'][0]
p key
end
jobs.each do |el|
p el['op_title']
p el['op_comm_status']
p el['op_tot_cand_prof']
p "http://odesk.com/jobs/#{el['ciphertext']}"
end