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! While you're at it, check out some resources Treehouse students have shared here.
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
Austin Erlandson
7,696 PointsPulling Image from another site
I'm trying to pull my FB profile picture from my FB profile using this link...
https://www.facebook.com/photo.php?fbid=10152885693074479&l=edfeb6ec76
and adding it to my code. The goal is that my webpage always shows my FB profile Pic and not a static picture I upload as a file into my html file structure.
I'm currently on the Web Design track at How to Make a Website - Style New Pages.
So that gives you an idea of the code that I have so far.
I figured I could somehow add the link to the photo in an img src="insert link here" alt="description" class="profile-photo
the only thing I changed was that instead of the img src = a direct file path to an image file in my directory. I used a link copied and pasted from my FB page.
How could I go about making this work?
4 Answers
Ryan Duchene
Courses Plus Student 46,022 PointsThe address of the page that displays the image is not always the same as the address of the image itself. This path should work.
Hilarious photo, by the way. :D
Austin Erlandson
7,696 Pointshahaha thanks Ryan!
Austin Erlandson
7,696 PointsSo I tried to add my source code to show you guys what I'm working with but it keeps sending me to an error page;/ Any other thoughts? The link you sent didn't work either? I think I just have a problem with my syntax?
Ryan Duchene
Courses Plus Student 46,022 PointsRight-click on the image, and there should be an option that says "Copy Image Path" or "Copy Image Address" or "Copy Image Full Path" or something like that. That (should) give you the entire path of the image.
However (and I probably should've noted this before), Facebook might have something set up so that it takes a different URL to display the image to different people. It works fine for me; I can click the link and see the image. I can also see the image embedded in my post above. Can you see it? Also, is the error page you're getting a 404 (Not Found)?
Austin Erlandson
7,696 PointsIt literally just says Holy Smokes but when I clicked on the Web Address it showed http://www.teamtreehouse.com/500/ Which I'm assuming is the error code?
Austin Erlandson
7,696 PointsTest Test...
<p>This is code!</p>
Austin Erlandson
7,696 Points <p>Here's the source code I'm having issues with...
<section>
<img src="https://www.facebook.com/photo.php?fbid=10152885693074479&l=edfeb6ec76" alt="Austin's Baby Photo" class="profile-photo">
<p>Check me out on FB<a href="http://facebook.com/austin.erlandson"> .</a></p>
</section>
I'd like for my web page to grab my profile pic from FB.
Also it'd be nice to have that picture be a selectable link to my FB Profile after the "Check me out on FB___"
</p>

bothxp
16,510 Pointsbothxp
16,510 Pointsso what was the link that you copied and pasted, and what happened when you tried it ?