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

#checkUsername(*args) ⇒ Object

Updates username for the user, fails if username does not meet requirements, or is taken by another user @accessibility: public key, secret key @methods: POST @format: json, jsonp @authenticated: true @limited: false @see: http://disqus.com/api/3.0/users/checkUsername.json

Examples:

Updates username for the user for 'the88' to 'saxonbeat'

Disqussion::Client.users.checkusername(:username => 'saxonbeat')

Parameters:

  • username (String)

    A Disqus username. Defaults to null. Minimum length of 3 and Maximum length of 30



13
14
15
16
17
# File 'lib/disqussion/client/users.rb', line 13

def checkUsername(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options[:username] = args.first
  response = post('users/checkUsername', options)
end

#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.



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

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.



51
52
53
54
55
56
# File 'lib/disqussion/client/users.rb', line 51

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.



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

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

#listActiveThreads(*args) ⇒ Hashie::Rash

BETA Returns a list of threads a user has participated in sorted by last activity. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: true @see: http://disqus.com/api/3.0/users/listActiveThreads.json

Examples:

Return a list of active threads user 1234 has been active on

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

Parameters:

  • options (Hash)

    A customizable set of options.

Returns:

  • (Hashie::Rash)

    Details on the list of active threads.



99
100
101
102
# File 'lib/disqussion/client/users.rb', line 99

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

#listActivity(*args) ⇒ Hashie::Rash

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

Examples:

Return a list of active threads user 1234 has been active on

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

Parameters:

  • options (Hash)

    A customizable set of options.

Returns:

  • (Hashie::Rash)

    Details on the list of active threads.



123
124
125
126
# File 'lib/disqussion/client/users.rb', line 123

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

#listFollowers(*args) ⇒ Hashie::Rash

BETA Returns a list of users a user is being followed by. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: true @see: http://disqus.com/api/3.0/users/listFollowers.json

Examples:

Return a list of users the user is currently being followed by

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

Parameters:

  • options (Hash)

    a customizable set of options

Returns:

  • (Hashie::Rash)

    Details on the users the user is being followed by.



144
145
146
147
# File 'lib/disqussion/client/users.rb', line 144

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

#listFollowing(*args) ⇒ Hashie::Rash

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

Examples:

Return a list of users the user is currently following

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

Parameters:

  • options (Hash)

    a customizable set of options

Returns:

  • (Hashie::Rash)

    Details on the users the user is following.



165
166
167
168
# File 'lib/disqussion/client/users.rb', line 165

def listFollowing(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get('users/listFollowing', options) 
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.



186
187
188
189
# File 'lib/disqussion/client/users.rb', line 186

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

#listMostActiveForums(*args) ⇒ Hashie::Rash

BETA Returns a list of forums a user has been active on recenty, sorted by the user's activity. @accessibility: public key, secret key @methods: GET @format: json, jsonp @authenticated: false @limited: true @see: http://disqus.com/api/3.0/users/listMostActiveForums.json

Examples:

Return a list of the forums the user has been most active on recently.

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

Parameters:

  • options (Hash)

    a customizable set of options

Returns:

  • (Hashie::Rash)

    Details on the users list of forums they have been most active on recently.



204
205
206
207
# File 'lib/disqussion/client/users.rb', line 204

def listMostActiveForums(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get('users/listMostActiveForums', options)
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.



227
228
229
230
# File 'lib/disqussion/client/users.rb', line 227

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.



244
245
246
247
248
249
# File 'lib/disqussion/client/users.rb', line 244

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