quora-client 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/quora/auth.rb +12 -0
- data/lib/quora/client.rb +8 -2
- metadata +3 -3
data/README.md
CHANGED
data/lib/quora/auth.rb
CHANGED
@@ -4,11 +4,23 @@ require 'uri'
|
|
4
4
|
require 'cgi'
|
5
5
|
|
6
6
|
|
7
|
+
#
|
8
|
+
# Quora client enables the communication with Quora API via REST interface
|
9
|
+
#
|
10
|
+
# (c) Juan de Bravo <juandebravo@gmail.com>
|
11
|
+
#
|
12
|
+
#
|
7
13
|
module Quora
|
14
|
+
#
|
15
|
+
# This mixin provides useful methods for authentication
|
16
|
+
#
|
8
17
|
module Auth
|
9
18
|
|
10
19
|
QUORA_URI = "http://www.quora.com"
|
11
20
|
|
21
|
+
#
|
22
|
+
# login with Quora user and password
|
23
|
+
#
|
12
24
|
def login(user, password)
|
13
25
|
endpoint = URI.parse(QUORA_URI)
|
14
26
|
|
data/lib/quora/client.rb
CHANGED
@@ -15,13 +15,19 @@ module Quora
|
|
15
15
|
# This is the main class to interact with Quora API.
|
16
16
|
#
|
17
17
|
# Actually there's no API security mechanism so interaction with API is
|
18
|
-
# based on authentication cookie
|
19
|
-
#
|
18
|
+
# based on authentication cookie or web authentication (providing user and password).
|
19
|
+
# If you don't want to expose user credentials You should get all the
|
20
|
+
# Quora cookies value from you browser and use it as argument while
|
21
|
+
# creating the Quora client:
|
20
22
|
#
|
21
23
|
# cookie = "m-b=<m-b-value>; m-f=<m-f-value>; m-s=<m-s-value>; ..."
|
22
24
|
#
|
23
25
|
# client = Quora::Client.new(cookie)
|
24
26
|
#
|
27
|
+
# Or using user credentials:
|
28
|
+
#
|
29
|
+
# client = Quora::Client.new({:user => valid_user, :password => valid_password})
|
30
|
+
#
|
25
31
|
# values = client.get_all
|
26
32
|
#
|
27
33
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quora-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Juan de Bravo
|