Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Disqus google gadget embed (note: haven't used this in a long while)
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Disqus embed" author="Stefan Sundin" width="640" height="390"></ModulePrefs>
<UserPref name="shortname" datatype="string" default_value="" />
<UserPref name="id" datatype="string" default_value="" />
<UserPref name="url" datatype="string" default_value="" />
<UserPref name="title" datatype="string" default_value="" />
<UserPref name="width" datatype="string" default_value="" />
<UserPref name="height" datatype="string" default_value="" />
<UserPref name="args" datatype="string" default_value="" />
<Content type="html">
<![CDATA[
<div id="disqus_thread"></div>
<script type="text/javascript">
var prefs = new gadgets.Prefs();
var disqus_shortname = prefs.getString("shortname");
var disqus_identifier = prefs.getString("id");
var disqus_url = prefs.getString("url");
var disqus_title = prefs.getString("title");
var dsq = document.createElement("script");
dsq.type = "text/javascript";
dsq.async = true;
dsq.src = "http://"+disqus_shortname+".disqus.com/embed.js";
(document.getElementsByTagName("head")[0] || document.body).appendChild(dsq);
/* Developer notes:
Example code (Google Project Hosting):
<wiki:gadget border="0" url="https://gist.githubusercontent.com/stefansundin/b59b19b47370eaa3c364/raw/disqus-gadget.xml" up_shortname="altdrag" up_id="altdrag" up_url="http://code.google.com/p/altdrag/" up_title="front page" width="100%" height="1000" />
*/
</script>
<style type="text/css">
body {
margin-top: 40px;
}
</style>
]]>
</Content>
</Module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment