Recommended:

  • phpclasses.org
  • jsclasses.org
  • jsmag.com
  • siteapps.com
  • View our reviews on Hot Scripts
  • JS Tutorial
  • scripts.com
  • securesignup.com




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:

<?php
function suggest($link, $title, $text) 
{
    $title = urlencode($title);
    $text = urlencode($text);
    $link = urlencode($link);
    echo "<span>";
    //twitter
    echo "<a href='http://twitter.com/home?status=".$text.": ".$link.
        "' title='Click to send this page to Twitter!' target='_blank'>";
        echo "<img src='/images/twitter.png' alt='Tweet about it'/>";
    echo "</a>";
    //facebook
    echo "&nbsp;<a href='http://www.facebook.com/sharer.php?u=".$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>";
    //digg.com
    echo "&nbsp;<a href='http://digg.com/submit?url=".$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='http://www.stumbleupon.com/submit?url=".$link.
        "&title=".$title."' title='Stumble upon' target='_blank'>";
        echo "<img src='/images/stumble.gif' alt='Stumble upon'/>";
    echo "</a>";
    //Myspace
    echo "&nbsp;<a href='http://www.myspace.com/Modules/PostTo/Pages/?u=".$link.
        "t=".$title."' title='Share on myspace' target='_blank'>";
        echo "<img src='/images/myspace.jpg' alt='Share on myspace'/>";
    echo "</a>";
    //Blogger
    echo "&nbsp;<a href='http://www.blogger.com/blog_this.pyra?t=".$title.
        "&u=".$link."&n=".$text."&pli=1' title='BlogThis' target='_blank'>";
        echo "<img src='/images/blogger.png' alt='BlogThis'/>";
    echo "</a>";
    //reddit.com
    echo "&nbsp;<a href='http://www.reddit.com/submit?url=".$link."&title=".
        $title."' title='Reddit' target='_blank'>";
        echo "<img src='/images/reddit.gif' alt='Reddit'/>";
    echo "</a>";
    //delicious
    echo "&nbsp;<a href='http://www.delicious.com/save?url=".$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='http://www.google.com/buzz/post?url=".$link.
        "' title='Click to buzz on Google!' target='_blank'>";
        echo "<img src='/images/buzz.png' alt='Buzz on google'/>";
    echo "</a>";
    echo "</span>";
}

suggest("http://webcodingeasy.com/PHP-APIs", "Suggest your content to other sites", 
        "Some more description");

?>

Here is an example:


You may also be interested in:

Powered by BlogAlike.com

blog comments powered by Disqus