Industry guru Dave Taylor offers free tech support on a wide variety of technical and business topics, including HTML, Apple iPhone, online advertising, Cascading Style Sheets, Web design, management, Unix, Linux, search engine optimization, online dating, Mac OS X, shell script programming and Microsoft Windows.

How can I create an "Add Me" Facebook button on my site?

I know you've written about how to create an "add me" button for MySpace, but, um, I'm not on MySpace, I'm on Facebook. is there some way to build or hack together an "add me" button for Facebook to add to my site instead? Thanks.


Dave's Answer:

That's an interesting question, and generally my answer would be "no" because Facebook has put a lot of effort into creating its own universe, generally one that's not easily reached from the rest of the Internet at large.

However, a colleague (thanks Trent Urbanski) gave me a little tip on how to reverse engineer just this sort of thing so let me share it with you so you too can create a nice "let's connect on Facebook" button for your blog or Web site...

The first thing you need to do is figure out your numeric account ID on Facebook.

The fastest way I know to get this information is to click on "Profile" on the top menu of your Facebook home page:

facebook navbar top left profile

Now scroll down a bit and you'll see your "Friends" box:

facebook profile friends count

Turns out that the link that shows you how many friends you have includes your Facebook account ID number, as you can see here:

facebook profile friends show url

You can simply copy that link with a Cmd-Click (or Right-Click) and paste it into an edit buffer to extract the numeric value. Mine account ID is 500501552 as you can see.

Now here's the hacking part: the link you want to create looks like this:

http://www.facebook.com/addfriend.php?id=yourID

For me, for example, it'd be:

http://www.facebook.com/addfriend.php?id=500501552

To make it into a button, simply wrap it in some rudimentary HTML:

<form action="http://www.facebook.com/addfriend.php"><input type="hidden" name="id" value="500501552" /><input type="submit" value="Connect with me on Facebook!" /></form>

That code looks like this in action:

Tweak and modify to your hearts content, and enjoy!

I'd also like to let you know that I have quite a bit of Facebook help here on the site and that I also have an Ask Dave Taylor Facebook Fan Page that I invite you to join.



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon    

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

Thanks for that wonderful solution.

Posted by: yomibalogun at August 17, 2009 12:43 PM

intresting

Posted by: rinul at February 26, 2010 10:06 PM

thanks for sharing this information with us

Posted by: sima at March 1, 2010 10:11 AM

I have something to say, now that you mention it, but ...
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you for all your efforts on this Web site by buying you a cup of coffee!

I do have a comment, now that you mention it!











Remember personal info?


Please note that I will never send you any unsolicited email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.








Ask Dave Taylor: The iPhone App: Advertisement



Follow me on Twitter @DaveTaylor

Search
Find just the answers you seek from among our 2300+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Book Links
© 2002 - 2010 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.