Skip to content

Instantly share code, notes, and snippets.

@dancsiqueira
Created August 27, 2013 13:30
Show Gist options
  • Select an option

  • Save dancsiqueira/6353527 to your computer and use it in GitHub Desktop.

Select an option

Save dancsiqueira/6353527 to your computer and use it in GitHub Desktop.
class window.Twitter
_self = this
@shareCount: (url) ->
if url != ''
query = "http://urls.api.twitter.com/1/urls/count.json?url=#{ url }&callback=?"
$.getJSON(query)
.done((data) ->
$(_self).trigger('tweetedCountResponse', data.count)
)
.fail (jqxhr, textStatus, error) ->
$(_self).trigger('tweetedCountResponse', false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment