Class: Disqussion::Users

Inherits:
Client
  • Object
show all
Defined in:
lib/disqussion/client/users.rb

Instance Method Summary collapse

Methods included from Request

#get, #post

Instance Method Details

#details(*args) ⇒ Hashie::Rash

Returns details of a user @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: false @see: http://disqus.com/api/3.0/users/details.json

Examples:

Return extended information for 'the88'

Disqussion::Client.user("the88")
Disqussion::Client.user(1234)  # Same as above

Parameters:

  • user (Integer, String)

    A Disqus user ID or screen name.

Returns:

  • (Hashie::Rash)

    Details on the requested user.



15
16
17
18
19
20
# File 'lib/disqussion/client/users.rb', line 15

def details(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  user = args.first
  merge_user_into_options!(user, options)
  response = get('users/details', options)
end

#follow(*args) ⇒ Hashie::Rash

Follow a user @accessibility: public key, secret key @methods: POST @format: json, jsonp @authenticated: true @limited: false @see: http://disqus.com/api/3.0/users/details.json

Examples:

Return extended information for 'the88'

Disqussion::Client.follow("the88")
Disqussion::Client.follow(1234)  # Same as above

Parameters:

  • target (Integer, String)

    A Disqus user ID or screen name.

Returns:

  • (Hashie::Rash)

    Details on the requested user.



34
35
36
37
38
39
# File 'lib/disqussion/client/users.rb', line 34

def follow(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  target = args.first
  merge_target_into_options!(target, options)
  response = post('users/follow', options)
end

#listActiveForums(*args) ⇒ Hashie::Rash

Returns a list of forums a user has been active on. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: false @see: http://disqus.com/api/3.0/users/listActiveForums.json

Examples:

Return a list of forums user 1234 has been active on

Disqussion::Client.users.listActiveForums(:user => 1234)

Parameters:

  • options (Hash)

    A customizable set of options.

Returns:

  • (Hashie::Rash)

    Details on the list of posts.



57
58
59
60
# File 'lib/disqussion/client/users.rb', line 57

def listActiveForums(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get('users/listActiveForums', options)
end

#listActiveThreads(*args) ⇒ Object

BETA Returns a list of threads a user has participated in sorted by last activity.



64
65
66
# File 'lib/disqussion/client/users.rb', line 64

def listActiveThreads(*args)
  
end

#listActivity(*args) ⇒ Object

BETA Returns a list of various activity types made by the user.



70
71
72
# File 'lib/disqussion/client/users.rb', line 70

def listActivity(*args)
  
end

#listFollowers(*args) ⇒ Object

BETA Returns a list of users a user is being followed by.



76
77
78
# File 'lib/disqussion/client/users.rb', line 76

def listFollowers(*args)
  
end

#listFollowing(*args) ⇒ Object

BETA Returns a list of users a user is following.



82
83
84
# File 'lib/disqussion/client/users.rb', line 82

def listFollowing(*args)
  
end

#listForums(*args) ⇒ Hashie::Rash

Returns a list of forums a user owns. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: false @see: http://disqus.com/api/3.0/users/listForums.json

Examples:

Return a list of forums owned by user 1234

Disqussion::Client.users.listForums(:user => 1234)

Parameters:

  • options (Hash)

    A customizable set of options.

Returns:

  • (Hashie::Rash)

    Details on the list of forums.



102
103
104
105
# File 'lib/disqussion/client/users.rb', line 102

def listForums(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get('users/listForums', options)
end

#listMostActiveForums(*args) ⇒ Object

BETA Returns a list of forums a user has been active on recenty, sorted by the user's activity.



109
110
111
# File 'lib/disqussion/client/users.rb', line 109

def listMostActiveForums(*args)
  
end

#listPosts(*args) ⇒ Hashie::Rash

Returns a list of posts made by the user. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: false @see: http://disqus.com/api/3.0/users/listPosts.json

Examples:

Return a list of user 1234s posts

Disqussion::Client.users.listPosts(:user => 1234)

Parameters:

  • options (Hash)

    A customizable set of options.

Returns:

  • (Hashie::Rash)

    Details on the list of forums.



131
132
133
134
# File 'lib/disqussion/client/users.rb', line 131

def listPosts(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get('users/listPosts', options)
end

#unfollow(*args) ⇒ Hashie::Rash

Unfollow a user @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: true @limited: false @see: http://disqus.com/api/3.0/users/details.json

Examples:

Return extended information for 'the88'

Disqussion::Client.unfollow("the88")
Disqussion::Client.unfollow(1234)  # Same as above

Parameters:

  • user (Integer, String)

    A Disqus user ID or screen name.

Returns:

  • (Hashie::Rash)

    Details on the requested user.



148
149
150
151
152
153
# File 'lib/disqussion/client/users.rb', line 148

def unfollow(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  target = args.first
  merge_target_into_options!(target, options)
  response = post('users/unfollow', options)
end