Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.