Developer Resources
Here at snap.fm we want to make it as easy as possible for your readers to submit your stories to snap.fm so that the entire community can see. To help achieve this we have developed three ways of easily incorporating snap.fm into your site depending on the level of integration you seek.
Graphical Buttons
These buttons offer the most integration with snap.fm. They not only allow your readers to see how many snap.fm votes a particular page on your site has gotten but to vote for the story directly without leaving your site if they were already logged into snap.fm. (Your readers will be redirected to snap.fm to submit the page as a story if it does not already exist.)
Usage
Place the following JavaScript code anywhere in the page with the article that you wish to integrate with snap.fm.
<script src="http://snap.fm/devs/snapBtn.js"
type="text/javascript">
</script>
Once the page is online in place the JavaScript code the snap.fm vote graphic will appear with full voting functionality.
Advanced Options
You may customize the snap.fm vote graphic to display the number of votes relating to any page that you want. To do this set the 'snapfm_url' variable. For example:
<script type="text/javascript">
snapfm_url='http://example.com/some_other_page.html';
</script>
<script src="http://snap.fm/devs/snapBtn.js"
type="text/javascript">
</script>
You can also customize the background color of the snap.fm vote graphic to match your site. To do this set the 'snapfm_background' variable to a three or six character hex color value without the preceding hash mark (#). For example:
<script type="text/javascript">
snapfm_background='474b44';
</script>
<script src="http://snap.fm/devs/snapBtn.js"
type="text/javascript">
</script>
Text Links With Vote Counts
These purely text links allow your reader to see how many votes a page has received at snap.fm while at the same time providing either a link to the story page at snap.fm or prompt the user to submit the page as a story depending on the status of the page.
Usage
Place the following code anywhere in the page where you what the text link to show up.
<script src="http://snap.fm/devs/snapLink.js"
type="text/javascript">
</script>
In place of the JavaScript code a plain link will be inserted and inherit the styling of a normal link on your page. If you wish to customize the look of the snap.fm link you may style the snapfm_jslink class.
Advanced Options
You may customize the snap.fm link to display the number of votes relating to any page that you want. To do this append an additional 'url' parameter. For example:
<script
src="http://snap.fm/devs/snapLink.js?url=http://example.com/some_page.html"
type="text/javascript">
</script>
Plain Links
With plain links you can control exactly what the link looks like and simply add the same link html code to any page that you want. When your readers click on the link snap.fm will figure out where the user is coming from and send the user to the right story page. (Or the story submission page if necessary.)
Usage
Simply link to the following URL with a standard a link.
http://snap.fm/devs/snapGoTo.php
Advanced Options
You may customize the link to redirect your reader to any snap.fm story page that you want. To do this append an additional 'url' parameter. For example:
http://snap.fm/devs/snapGoTo.php?url=http://example.com/some_other_page.html