Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Adding Pages to a Website Build the Contact Page

Jair Fernandes
Jair Fernandes
2,234 Points

What is the Facebook equivilent to twitter link <a href="http://twitter.com/intent/tweet?screen_name=example">?

I want to use a Facebook link instead of a twiiter link, but I'd like it to be like the twitter link, such that, you dont see the profile just get a comment screen.

2 Answers

I don't believe there is an easy way to do this like the Twitter link. I believe you have to use a Facebook API. Here is a link, I found for it: https://developers.facebook.com/docs/plugins

I don't think Facebook officially supports it anymore, but you'll find many people/services still use the sharer.php script/page:

<a href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fteamtreehouse.com">Share</a>

Note that the value of the u variable/query string should be URL encoded.

This will open a page that will first ensure the user is logged in to Facebook and then fetch the OpenGraph info of the site (including things like the title, thumbnail image(s) and a description), and allow them to enter their own comment/post text, select where to post to, and finally what the audience should be.