├── README.markdown ├── audiencesync └── php │ ├── as-callback.php │ ├── config.php │ └── index.php ├── mobile-sso ├── README.md ├── js-server-demo │ ├── index.js │ ├── package.json │ └── views │ │ └── index.html └── swift-demo │ ├── .DS_Store │ ├── Podfile │ ├── test.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── derricklin.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── derricklin.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ └── xcschememanagement.plist │ ├── test.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── derricklin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ └── test │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── SceneDelegate.swift │ ├── ViewController.swift │ └── test.xcdatamodeld │ ├── .xccurrentversion │ └── test.xcdatamodel │ └── contents ├── mobile ├── js │ ├── README.md │ └── mobiletemplate.html └── swift-demo-social-login │ ├── README.md │ ├── node_server │ ├── .env │ ├── index.js │ ├── package.json │ └── views │ │ └── index.html │ └── social_login_client │ ├── Podfile │ ├── Podfile.lock │ ├── Pods │ ├── Alamofire │ │ ├── LICENSE │ │ ├── README.md │ │ └── Source │ │ │ ├── AFError.swift │ │ │ ├── Alamofire.swift │ │ │ ├── AlamofireExtended.swift │ │ │ ├── AuthenticationInterceptor.swift │ │ │ ├── CachedResponseHandler.swift │ │ │ ├── Combine.swift │ │ │ ├── DispatchQueue+Alamofire.swift │ │ │ ├── EventMonitor.swift │ │ │ ├── HTTPHeaders.swift │ │ │ ├── HTTPMethod.swift │ │ │ ├── MultipartFormData.swift │ │ │ ├── MultipartUpload.swift │ │ │ ├── NetworkReachabilityManager.swift │ │ │ ├── Notifications.swift │ │ │ ├── OperationQueue+Alamofire.swift │ │ │ ├── ParameterEncoder.swift │ │ │ ├── ParameterEncoding.swift │ │ │ ├── Protected.swift │ │ │ ├── RedirectHandler.swift │ │ │ ├── Request.swift │ │ │ ├── RequestInterceptor.swift │ │ │ ├── RequestTaskMap.swift │ │ │ ├── Response.swift │ │ │ ├── ResponseSerialization.swift │ │ │ ├── Result+Alamofire.swift │ │ │ ├── RetryPolicy.swift │ │ │ ├── ServerTrustEvaluation.swift │ │ │ ├── Session.swift │ │ │ ├── SessionDelegate.swift │ │ │ ├── StringEncoding+Alamofire.swift │ │ │ ├── URLConvertible+URLRequestConvertible.swift │ │ │ ├── URLEncodedFormEncoder.swift │ │ │ ├── URLRequest+Alamofire.swift │ │ │ ├── URLSessionConfiguration+Alamofire.swift │ │ │ └── Validation.swift │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── SwiftyJSON │ │ ├── LICENSE │ │ ├── README.md │ │ └── Source │ │ │ └── SwiftyJSON │ │ │ └── SwiftyJSON.swift │ └── Target Support Files │ │ ├── Alamofire │ │ ├── Alamofire-Info.plist │ │ ├── Alamofire-dummy.m │ │ ├── Alamofire-prefix.pch │ │ ├── Alamofire-umbrella.h │ │ ├── Alamofire.debug.xcconfig │ │ ├── Alamofire.modulemap │ │ └── Alamofire.release.xcconfig │ │ ├── Pods-social_login_client │ │ ├── Pods-social_login_client-Info.plist │ │ ├── Pods-social_login_client-acknowledgements.markdown │ │ ├── Pods-social_login_client-acknowledgements.plist │ │ ├── Pods-social_login_client-dummy.m │ │ ├── Pods-social_login_client-frameworks-Debug-input-files.xcfilelist │ │ ├── Pods-social_login_client-frameworks-Debug-output-files.xcfilelist │ │ ├── Pods-social_login_client-frameworks-Release-input-files.xcfilelist │ │ ├── Pods-social_login_client-frameworks-Release-output-files.xcfilelist │ │ ├── Pods-social_login_client-frameworks.sh │ │ ├── Pods-social_login_client-umbrella.h │ │ ├── Pods-social_login_client.debug.xcconfig │ │ ├── Pods-social_login_client.modulemap │ │ └── Pods-social_login_client.release.xcconfig │ │ └── SwiftyJSON │ │ ├── SwiftyJSON-Info.plist │ │ ├── SwiftyJSON-dummy.m │ │ ├── SwiftyJSON-prefix.pch │ │ ├── SwiftyJSON-umbrella.h │ │ ├── SwiftyJSON.debug.xcconfig │ │ ├── SwiftyJSON.modulemap │ │ └── SwiftyJSON.release.xcconfig │ ├── social_login_client.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── social_login_client.xcscheme │ ├── social_login_client.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── social_login_client │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ ├── SceneDelegate.swift │ ├── ViewController.swift │ └── test.xcdatamodeld │ ├── .xccurrentversion │ └── test.xcdatamodel │ └── contents ├── notifications ├── README.markdown ├── embed.html └── php │ └── sendnotification.php ├── oauth ├── php │ └── oauth │ │ ├── README.markdown │ │ ├── all-in-one.php │ │ ├── oauth-callback.php │ │ └── oauth-test.php └── python │ ├── oauth_example.py │ └── requirements.txt ├── snippets ├── js │ ├── comment-counts-api │ │ └── commentcounts.html │ └── disqus-reset │ │ ├── README.markdown │ │ └── disqus_reset.html └── php │ ├── batch_add_to_whitelist_from_csv.php │ ├── deduping_script.php │ ├── get-sso-username.php │ ├── get-thread-details.php │ ├── list-100-most-active-users.php │ ├── list-all-replies-to-a-parent.php │ ├── list-all-threads-between-date-and-now.php │ ├── open-threads-since-date.php │ ├── single_access_token.php │ ├── sso_test_recipe.php │ ├── update-thread-title.php │ └── user-details-from-comment-id.php ├── sso ├── coldfusion │ └── sso.cfm ├── cs │ └── DisqusSSO.cs ├── elixir │ └── sso.ex ├── java │ └── sso.java ├── javascript │ ├── hmac-sha1-3.1.2.js │ └── main.js ├── php │ └── sso.php ├── python2 │ └── sso.py ├── python3 │ └── sso.py ├── ruby │ └── sso.rb └── scala │ └── Disqus.scala └── widgets └── php ├── latest_comments.php └── popular_threads ├── config.php ├── getfromcache.php └── getpopularthreads.php /README.markdown: -------------------------------------------------------------------------------- 1 | # DISQUS API Recipes 2 | 3 | A cookbook of common recipes to help expedite your development process when using the [DISQUS API](http://disqus.com/api). 4 | 5 | ## Table of Contents 6 | 7 | ### Beginner 8 | 9 | * Get a thread's details: /php/get-thread-details.php 10 | * List a forum's 100 most active users and their comment counts: /php/list-100-most-active-users.php 11 | * Get an SSO account's username: /php/get-sso-username.php 12 | * Create a guest comment: /php/create-guest-comment.php 13 | * Locates and deletes duplicate comments: /php/deduping_script.php 14 | 15 | ### Intermediate 16 | 17 | * List all replies to a parent comment: /php/list-all-replies-to-a-parent.php 18 | * List all threads created between a given date and now: /php/list-all-threads-between-date-and-now.php 19 | * Add users to the whitelist via CSV file: /php/add_to_whitelist.php 20 | * Close a thread using a single access token: /php/single_access_token.php 21 | * Three-button test script for DISQUS.reset (AJAX reset method): /html/disqus_reset.html 22 | * OAuth example: /oauth/oauth-test.php 23 | 24 | ### Advanced 25 | * Test SSO with a single user: /php/sso_test_recipe.php 26 | * Generate an SSO remote_auth_s3 payload in C# .NET: /ASP.NET/generate_SSO_payload.cs 27 | * (1/2) Get a forum's most popular threads and write to a cache file: /php/get_and_write_popular_threads_to_cache.php 28 | * (2/2) Get popular threads from cache file and display them: /php/get_popular_threads_from_cache.php 29 | 30 | ## Requirements 31 | 32 | For PHP scripts: 33 | 34 | * PHP, preferably the latest version 35 | * (Optional) [DISQUS API bindings for PHP](https://github.com/disqus/disqus-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. 36 | 37 | ## Usage 38 | 39 | Run any of these files as-is. Enjoy! 40 | 41 | ## Requests 42 | 43 | [Email us any requests](http://disqus.com/support). 44 | 45 | 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. 46 | 47 | ## Support 48 | 49 | 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. -------------------------------------------------------------------------------- /audiencesync/php/as-callback.php: -------------------------------------------------------------------------------- 1 | 2 | 33 |
34 |