Skip to content

Instantly share code, notes, and snippets.

View ryanvalentin's full-sized avatar

Ryan Valentin ryanvalentin

View GitHub Profile
@ryanvalentin
ryanvalentin / gist:5416819
Last active December 16, 2015 09:59
Example usage of the Disqus SSO example class
/*
In your code-behind file, create a new instance of the DisqusSSO class, set the API key and call the generate method. NOTE: The method is overloaded and will optionally accept an avatar URL and/or a profile URL.
Depends on SSO class payload generator found here: https://github.com/disqus/DISQUS-API-Recipes/blob/master/cs/sso/DisqusSSO.cs
*/
public string Payload { get; private set; }
public void GetSSOPayload(bool authenticated)
{
@ryanvalentin
ryanvalentin / gist:5416761
Last active January 12, 2017 16:50
Generate Disqus SSO payload in Java
/*
This script will calculate the Disqus SSO payload package
Please see the Integrating SSO guide to find out how to configure your account first:
http://help.disqus.com/customer/portal/articles/236206
This example uses the Jackson JSON processor: http://jackson.codehaus.org/Home
*/
String DISQUS_SECRET_KEY = "<YOUR_SECRET_KEY>"; // Your Disqus secret key from http://disqus.com/api/applications/
// User data, replace values with authenticated user data
@ryanvalentin
ryanvalentin / gist:5248630
Created March 26, 2013 19:54
Update all thread titles based on Query
<?php
date_default_timezone_set('America/Los_Angeles');
$apikey = '<your disqus secret key>'; // Your Disqus secret key from http://disqus.com/api/
$forum = '<your forum shortname>';
$limit = '100'; // max is 100 for this endpoint. 25 is default
$order = 'asc'; // asc = oldest to newest. default is desc
$since = '1362117600'; // 1362117600 = March 1, 2013 at Midnight
$accessToken = '<your admin access token>'; // Get your access token from your API application page: http://disqus.com/api/applications/