Giter VIP home page Giter VIP logo

disqus-api-recipes's Introduction

DISQUS API Recipes

A cookbook of common recipes to help expedite your development process when using the DISQUS API.

Table of Contents

Beginner

  • Get a thread's details: /php/get-thread-details.php
  • List a forum's 100 most active users and their comment counts: /php/list-100-most-active-users.php
  • Get an SSO account's username: /php/get-sso-username.php
  • Create a guest comment: /php/create-guest-comment.php
  • Locates and deletes duplicate comments: /php/deduping_script.php

Intermediate

  • List all replies to a parent comment: /php/list-all-replies-to-a-parent.php
  • List all threads created between a given date and now: /php/list-all-threads-between-date-and-now.php
  • Add users to the whitelist via CSV file: /php/add_to_whitelist.php
  • Close a thread using a single access token: /php/single_access_token.php
  • Three-button test script for DISQUS.reset (AJAX reset method): /html/disqus_reset.html
  • OAuth example: /oauth/oauth-test.php

Advanced

  • Test SSO with a single user: /php/sso_test_recipe.php
  • Generate an SSO remote_auth_s3 payload in C# .NET: /ASP.NET/generate_SSO_payload.cs
  • (1/2) Get a forum's most popular threads and write to a cache file: /php/get_and_write_popular_threads_to_cache.php
  • (2/2) Get popular threads from cache file and display them: /php/get_popular_threads_from_cache.php

Requirements

For PHP scripts:

  • PHP, preferably the latest version
  • (Optional) DISQUS API bindings for PHP — none of these .php files require the bindings. Only use the bindings if you know you need them and already know how to use them.

Usage

Run any of these files as-is. Enjoy!

Requests

Email us any requests.

Note: The integrity and utility of these recipes is very important to us. This means keeping them tidy and aimed at a wide audience. If you request a very specific recipe we may make it less specific so it's more accessible.

Support

These recipes are meant as a starting point. Most recipes have only been tested to work with the latest version of Chrome stable at the time of creation. YMMV.

disqus-api-recipes's People

Contributors

alexfilatov avatar alexwilton avatar chiliec avatar drake69 avatar gddh avatar gddhatdisqus avatar hlgott1593 avatar hovspian avatar louisrli avatar northisup avatar rxaviers avatar ryanvalentin avatar sagarjunnarkar avatar smithc avatar taltonfiggins avatar the-wazz avatar thetylerhayes avatar tterb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

disqus-api-recipes's Issues

disqus_config

Why is disqus_config not used in the example (/js/disqus-reset/disqus_reset.html)?

Is there a way to create moderators via SSO

Hi,

This is obviously not an issue with the library but I don't know a better place to ask:

We are already using Disqus SSO successfully however we need to define a set of moderators our of the new SSO users we create for every event. Right now we allow the SSO user to e created and after that manually we copy the @ssouseridhash and we add it as moderator of the site, something we can have as many as 20 moderators. Wondering if there is a way to specify the new user is meant to be a moderator when creating hmac data.

Thanks!

Integrating disqus in a mobile app

Hi,

I'm following your guide to display disqus comments on my Android app. It works fine for the most part as comments are being displayed nicely. However, I can't get the login flow to work whether it's via email or through any of the social media. The result is that my users can see the comments but cannot login or add any new comments.Anyone following this guide can easily reproduce this behaviour. I'm suspecting that the popup window that you now display on clicking Login doesn't play well with embedded webview.
Any suggestions on how to solve this?

disqus_reset.html unused vars

these are never used (on the page). some comments as to why they're there (if they are needed) would be helpful.

var disqus_identifier = ...
var disqus_url = ...
var disqus_config ...

Websocket connection to xxx failed on Chromium

Hi, current i'm developing mobile apps (Xamarin) using disqus javascript mobile embed solution. While on Windows Phone work fine, on Android (minimum 5.0) WebView based on Chromium, this solution never work flawlessly.

I can login and success, but when back to embed page, i'm still not logged in. When try login again, i automatically back to embed page without enter credential again, and i assume session or cookies is work fine.

Trying see debug output, i've found this:

[chromium] [INFO:CONSOLE(0)] "Scripts may close only the windows that were opened by it.", source: (0)
[chromium] [INFO:CONSOLE(1)] "WebSocket connection to 'ws://realtime.services.disqus.com/ws/2/thread/3673053070?' failed: Error during WebSocket handshake: Unexpected response code: 400", source: http://a.disquscdn.com/next/embed/lounge.bundle.20b16d338a6075d33134dcc2ade8eb76.js (1)

Not sure, what is that, but i think the cause of this problem is disqus trying use websocket that not work on chromium ?

Temporary solution i have found is set my android target build to 4.4 and it will work fine.

"Comment reply created" notification

I wanna implement a feature where I notify my users that someone replied on their comment.

I looked deep into the onNewComment in the js lib, but there wasn't information whether the new comment is a reply or not, and to which comment.

Am I approaching this wrong?

Disqus resize on orientation change?

Hello,

I found this repo via this help page:

Using Disqus on AJAX sites

... which I found via this Stack posting:

How to reset Disqus width on mobile orientation change

I'm hoping someone here could help me out.

Problem:

I've recently noticed that the Disqus embed does not resize on my iPhone during an orientation change.

Questions:

  1. Is this the expected behavior? I assumed the Disqus embed is supposed to scale to fit its container ... This appears to be true, except for orientation changes.
  2. If Disqus embed doesn't scale up/down, horizontally, to fit the container on orientation change, is the above Stack answer really the best way to make the Disqus embed scale to fit the container size on orientation change?

Is there an API recipe that could help me here?

Thanks!!! :octocat:

Location of recipes needs snippets prefix to path in README.markdown (but I found it eventually)

In the README.markdown section on https://github.com/disqus/DISQUS-API-Recipes the documentation refers to code for example: /php/get-thread-details.php

But is is not clear where in the repository this actually is: there's no php directory shown in the view of the repo on the same page above the README.markdown.

Fortunately I figured out where this is by searching in google for one of the files. The location of the examples is: https://github.com/disqus/DISQUS-API-Recipes/tree/master/snippets/php

Please update the documentation with this snippets prefix. Thanks.

ruby / sso.rb

Hi! I am trying to change the avatar of DISQUS in order to use custom avatars. Then I ended up here. How do I implement sso.rb in my Rails App? 'cause I see the code and realized that I have to create a Json object with the parameters and finally embed a javascript tag with the disqus funtion.

My questions are. Do I need to use explicitly the sso.rb? can I implement my own helper in order to embed the js code? do the js code need to be inside of a function (load event) ?

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.