How does facebook know what image to use when you post a link? [duplicate] - html

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How does Facebook detect images when adding a link?
hi all, curious how facebook is able to pull an accurate image when you post a link. I know they first look for a meta tag with the image the site owner wants them to use but if that doesn't exist what logic do you think they do to get what image should be presented if you link to a blog article let's say.

They most likely grab the source of the page and analyze it to extract the biggest images. They probably look for images close to the center of the page, images that are prominent. It's also possible that they analyze other similar pages on the site to determine unique images that aren't common across pages (this would help FB rule out images used for navigation, headers, decoration, etc.) Not sure how it determines how many perspective images to grab, though.

Related

Is it possible to share a website without hosting it? [duplicate]

This question already has answers here:
Is there anyway to render a website and share it without hosting it?
(2 answers)
Closed 1 year ago.
So recently I started a project to expand my knowledge when it comes to HTML and CSS. I made a little website just for myself and I want to get some feedback from my friend.
I want him to be able to maybe click on a link and then get to my website (doesn't have to be a link). So I don't want to publish the website for anyone but for my friend or anyone that has that link or something like that.
I already heard about sharing files to someone on OneDrive and including all the code in it but my OneDrive is already out of storage so something different would be nice.
It is best to use pages.github.com check the page is a small post and video tutorial on how to use it, greetings bro!

How to choose which image FB displays? [duplicate]

This question already has answers here:
How does Facebook Sharer select Images and other metadata when sharing my URL?
(12 answers)
Closed 5 years ago.
You may know that when you share a link on Facebook, it selects one/some of the images from the page and you can't really control which image is the thumbnail.
Long story short, I've read that some simple html in my website can help FB determine what image to choose.
We are using WordPress. I actually want to achieve this:
How do a change the thumbnail image of my link when posting to facebook?
I am total beginner in html/wordPress and only helping a friend. Any help?
Open graph data will allow your chosen content to display on Facebook and Twitter.
http://ogp.me
For an image you would place in the HEAD of your HTML document:
<meta property="og:image" content="http://example.com/img/test.jpg" />

Menu from external file [duplicate]

This question already has answers here:
What are the new frames? [closed]
(3 answers)
Closed 9 years ago.
I am now making a webpage and need a bit of help. Its been some time since Ive done my last page a few years ago. Back then I remember it was quite popular to use frames, but these days, this is basically no longer used.
What I used to do is have a horizontal menu on the top as a frame, and underneath it the content frame.
Now, currently I have a webpage again, where I would like to place a horizontal menu on the top of the page.
The menu is written in pure CSS and HTML. The CSS is loaded from an external file, but the problem I now have is that the menu is basically a DIV element, which however I have to put into each page separately.
I was just wondering there must be a way of making this simpler and have it somehow inserted from an external file again - sorry maybe it sounds confusing, but basically I am looking for an alternative of the frames used in the past. Many pages have menus and I am sure they do it somehow, because if I make a change in the menu, I dont want to be making these changes on all the hundreds of pages.
I dont ask for any specific coding etc. I can google that myself if I dont know how to do it, but I just need a general recommendation how to solve this. Just to summarize, the menu is in HTML+CSS and the pages are mostly PHP, some of them HTML.
I'd think it would mostly depend on the framework. You could just have one page, and use AJAX to load the content of each page, or you could have several php pages, all of which call some function at the beginning to set up the header, or you could use a ASP.NET master page or whatever your framework uses.
If you're using PHP, then the easiest way would be :
<?php include('my_page.html'); ?>
Be carefull of the path to your html page

Images in a mySQL database [duplicate]

This question already has answers here:
Storing Images in DB - Yea or Nay?
(56 answers)
Closed 8 years ago.
I'm making a website for my brother's webcomic, which was previously hosted on Tumblr. What is the most efficient/logical option for storing the pictures?
Downloading and putting the path in the Db
Storing them in the database, base64-encoded
linking directly to the pictures on Tumblr
wat do?
If the tumblr site is going to remain active I would lean towards using the Tumblr API to get at the photos. You could then just write some javascript/jquery functions to display the images however you want.
I've done something similar in the past with Google Picasa Albums and it worked out pretty well.
http://www.tumblr.com/docs/en/api/v2#photo-posts
Just a little additional info, in the past I've found using jquery plugins sometimes makes it a bit mor simple to get at the data I'm looking for.
Never used this one in particular but just a quick search and found this as an example of one that might be helpful.
https://github.com/Iaaan/jQuery-plugin-for-Tumblr-API

Facebook picking up an image from a page [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How does Facebook Sharer select Images?
I'm curious as to why Facebook doesn't always pick up an image for a link that is posted when there are plenty of images on the page? I have several images but I cannot seem to get it to register one for it's link.
http://www.rubytuesdaycreative.co.uk
Is there anything I can do? Is it possible to create a particular image in my site that is hidden but Facebook will pick up on?
Use OpenGraph Meta Tags. Specifically, I think you want the og:image one like this:
<meta property="og:image" content="http://davidwalsh.name/wp-content/themes/klass/img/facebooklogo.png"/>