Twitter count now links to search results

This commit is contained in:
Carlos Fenollosa 2014-07-07 17:23:24 +02:00
parent 1a4ea1702f
commit f946c98c32

3
bb.sh
View File

@ -429,7 +429,8 @@ twitter() {
if [[ -z "$global_disqus_username" ]]; then if [[ -z "$global_disqus_username" ]]; then
if [[ "$global_twitter_cookieless" == "true" ]]; then if [[ "$global_twitter_cookieless" == "true" ]]; then
id=$RANDOM id=$RANDOM
echo "<p id='twitter'><a href='http://twitter.com/intent/tweet?url=$1&text=$template_twitter_comment&via=$global_twitter_username'>$template_comments $template_twitter_button <span id='count-$id'></span></a>&nbsp;</p>" echo "<p id='twitter'><a href='http://twitter.com/intent/tweet?url=$1&text=$template_twitter_comment&via=$global_twitter_username'>$template_comments $template_twitter_button</a> "
echo "<a href='https://twitter.com/search?q=$1'><span id='count-$id'></span></a>&nbsp;</p>"
# Get current tweet count # Get current tweet count
echo '<script type="text/javascript">$.ajax({type: "GET", url: "http://urls.api.twitter.com/1/urls/count.json?url='$1'", echo '<script type="text/javascript">$.ajax({type: "GET", url: "http://urls.api.twitter.com/1/urls/count.json?url='$1'",
dataType: "jsonp", success: function(data){ $("#count-'$id'").html("(" + data.count + ")"); }}); </script>' dataType: "jsonp", success: function(data){ $("#count-'$id'").html("(" + data.count + ")"); }}); </script>'