• View our reviews on Hot Scripts
  • JS Tutorial

Recent Comments

Powered by Disqus

Back to articles

Suggest your content to other sites

This is not exactly API related thing, just a function that allows to create your content suggestions to other sites like twitter, google buzz and facebook. Of course by modifying you can add more sites.

It is also recommended to use url shortening service, because sites like twitter has limited symbols.

So code for function:

function suggest($link, $title, $text) 
    $title = urlencode($title);
    $text = urlencode($text);
    $link = urlencode($link);
    echo "<span>";
    echo "<a href='".$text.": ".$link.
        "' title='Click to send this page to Twitter!' target='_blank'>";
        echo "<img src='/images/twitter.png' alt='Tweet about it'/>";
    echo "</a>";
    echo "&nbsp;<a href='".$link."&t=".$text.
        "' title='Click to share this page on Facebook!' target='_blank'>";
        echo "<img src='/images/facebook.gif' alt='Face book sharer'/>";
    echo "</a>";
    echo "&nbsp;<a href='".$link."&title=".
        $title."&bodytext=".$text."' title='Digg it' target='_blank'>";
        echo "<img src='/images/digg.gif' alt='Digg it'/>";
    echo "</a>";
    //stumble upon
    echo "&nbsp;<a href='".$link.
        "&title=".$title."' title='Stumble upon' target='_blank'>";
        echo "<img src='/images/stumble.gif' alt='Stumble upon'/>";
    echo "</a>";
    echo "&nbsp;<a href='".$link.
        "t=".$title."' title='Share on myspace' target='_blank'>";
        echo "<img src='/images/myspace.jpg' alt='Share on myspace'/>";
    echo "</a>";
    echo "&nbsp;<a href='".$title.
        "&u=".$link."&n=".$text."&pli=1' title='BlogThis' target='_blank'>";
        echo "<img src='/images/blogger.png' alt='BlogThis'/>";
    echo "</a>";
    echo "&nbsp;<a href='".$link."&title=".
        $title."' title='Reddit' target='_blank'>";
        echo "<img src='/images/reddit.gif' alt='Reddit'/>";
    echo "</a>";
    echo "&nbsp;<a href='".$link."&title=".$title.
        "&notes=".$text."&tags=&noui=no&share=yes&jump=yes' ".
        "title='Bookmark to delicious' target='_blank'>";
        echo "<img src='/images/delicious.png' alt='Bookmark to delicious'/>";
    echo "</a>";
    //google buzzz
    echo "&nbsp;<a href='".$link.
        "' title='Click to buzz on Google!' target='_blank'>";
        echo "<img src='/images/buzz.png' alt='Buzz on google'/>";
    echo "</a>";
    echo "</span>";

suggest("", "Suggest your content to other sites", 
        "Some more description");


Here is an example:

You may also be interested in:

Powered by

blog comments powered by Disqus