topical media & game development

talk show tell print

mashup-flickr-12-GM-xmlhttpRequestExample.user.js / js



  // ==UserScript==
  // @name           GM_xmlhttpRequest Example
  // @namespace      http://www.dopiaza.org/flickr/greasemonkey/
  // @description    GM_xmlhttpRequest Example 
  // @include        http://www.flickr.com/photos/dopiaza/29900246/
  // ==/UserScript==
  
  var technoratiAPIKey = 'YOUR-TECHNORATI-API-KEY';
  
  var url = 'http://api.technorati.com/cosmos';
  var params = 'key=' + technoratiAPIKey + '&url=' + window.location.href + '&limit=100';
  
  GM_xmlhttpRequest(
    {
        method: "GET",
        url: url + "?" + params,
        headers:
        {
          "User-Agent": "Flickr-Technorati-Query"
        },
        onload: function(response) 
        {
          GM_log ("Response:" + response.responseText);
        },
        onerror: function(response)
        {
          GM_log ("Error:" + response.status + " " + response.statusText);
          GM_log (response.responseText);
        }
    });
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.