A simple web-service that allows GitHub Gists to be used via AJAX
JavaScript Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app Re-implemented caching of Gists Jun 24, 2010
config Updated Gist model to use asynchronous HTTP requests. Updated applica… Jun 12, 2010
db Converted application to run under Rails 3 Jun 12, 2010
doc Added blank rails app Jun 5, 2010
lib/tasks Converted application to run under Rails 3 Jun 12, 2010
log Added blank rails app Jun 5, 2010
public Converted application to run under Rails 3 Jun 12, 2010
script
test
tmp Added blank rails app Jun 5, 2010
vendor/plugins Converted application to run under Rails 3 Jun 12, 2010
.gitignore
Gemfile
README.rdoc Small update to README heading Jun 6, 2010
Rakefile
config.ru Updated Gist model to use asynchronous HTTP requests. Updated applica… Jun 12, 2010

README.rdoc

Ajax-Gist

Ajax-Gist is a simple web-service that acts as a proxy between your website and the GitHub Gist service to provide a translation of the Gist embed code that is AJAX friendly.

The normal Gist embed code uses Javascript 'document.write' commands to insert the Gist into your webpage. This is a problem when you want to insert a Gist after the page has loaded as 'document.write' will wipe out the current content of the page!

This service is mainly aimed at people that need to embed Gists in their application in a non-standard fashion. The service was inspired by the need to embed Gists in pages via AJAX for ReadMyCode.org

To use the service simply grab the Gist ID that you're after and embed it in a script tag pointing to the web-service like so:

<script src="http://ajax-gist.com/gist/419993.js" type="text/javascript"></script>
                                         ^ Gist ID

Check out the examples page to see simple demos using the service both statically and dynamically.

Gists accessed via this web-service are cached for 30 minutes, so if you make any changes to an existing Gist it will take 30 minutes before you see the changes.

Author & Credits

Author

Aaron Gough

Copyright © 2010 Aaron Gough (thingsaaronmade.com), released under the MIT license