lucky 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lucky/version.rb +1 -1
- data/lib/lucky.rb +5 -3
- metadata +1 -1
data/lib/lucky/version.rb
CHANGED
data/lib/lucky.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
require "lucky/version"
|
2
|
-
|
3
|
-
require "uri"
|
2
|
+
|
4
3
|
|
5
4
|
|
6
5
|
module Lucky
|
7
6
|
|
7
|
+
require "net/http"
|
8
|
+
require "uri"
|
9
|
+
|
8
10
|
def self.printname(name)
|
9
11
|
uri = URI.parse("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%20%3D%20%22http%3A%2F%2Fwww.ganeshaspeaks.com%2Faries%2Faries-daily-horoscope.action%22%20and%20xpath%3D%22%2F%2Fdiv%5B%40class%3D'gs_txt_box_1'%5D%22&diagnostics=true")
|
10
12
|
#uri = URI.parse("http://www.ganeshaspeaks.com/taurus/taurus-daily-horoscope.action")
|
@@ -15,6 +17,6 @@ module Lucky
|
|
15
17
|
#request.basic_auth username, password
|
16
18
|
request["Content-Type"] = "application/xml"
|
17
19
|
response = http.request(request)
|
18
|
-
|
20
|
+
return response.body
|
19
21
|
end
|
20
22
|
end
|