Image not displaying when shared on Facebook - ruby-on-rails

I have a small Rails application which I occasionally share on Facebook. Despite there being images on the front page, If I share the this, no thumbnails are displayed. Is there anything I need to do to make sure Facebook can pick up the images, or is there any reason why it wouldn't pick something up from my page? Link to my website

The og:image you're defining - according to the FB Debugger - http://pastonpaper.com/logo.jpg is 404ing. Once you fix that and any other errors, you should be good to go.

Related

Error parsing input URL, no data was cached, or no data was scraped. (2015)

i share websites content through Facebook Open Graph on Facebook.
But some of the URL give the above error (though the url of posts and its images are correct).
in example.
this url works:
http://dehmazang.org/post?id=00061&cat=articles
or if i change its category(articles) to (roznigar)
it also works:
and if i just change its category(articles) to (goftago)
it doesn't work
and also changing to some other categories doesn't work.
I don't really know is there fault with website or Facebook.
Stackoverflow is a place for people writing their own code, webapps might be a better place to ask, or superuser.stackexchange.com
Facebook's scraper works the same way with all website, it's about the setup on their individual website, put the links into http://developers.facebook. com/tools/debug

Can you put a hyperlink in a UIActivityItemProvider?

I have a huge link. I want to share this link when a user in my app posts to facebook from within the app. However my link is too large so I'd like to shorten it. Is there anyway (natively) I could have something like "Download the app HERE" where HERE redirects to my super long link?
What you're looking to do really can't be done with UIActivityViewController since each service has a completely different mechanism for encoding/representing links. Your best is probably to use some kind of URL shortening service such as Google's

Explicity disable image sharing to facebook using mini_fb gem

I use mini_fb to share text and images to facebook. My requirement is
When share text then it should share only text
When share text with image, then both text and image should be shared.
My problem is when I share text only, then a random image from the url is posted to facebook along with text. When I searched for it, I found that facebook is picking up images with og:image tag, and picking the last image and posted it.
But there is no explicit meta tag with property "og:image" in my site.
To avoid this I also put explicit meta tag with property "og:image". But the client does not need this.
Can I explicity disable image sharing to facebook, when no image is shared to facebook using 'mini_fb' gem?
it seems that at the moment it isn't possible, not because of the gem, but because of facebook.
By removing the ability to customize link metadata (i.e. headline, description, image) from all link sharing entry points on Facebook, we are eliminating a channel that has been abused to post false news.
you can see more information about this here
https://developers.facebook.com/blog/post/2017/06/27/API-Change-Log-Modifying-Link-Previews/
the way you solved it at the moment is the right way. it's better for you to set explicit the image you want to show, so there is more control about it by you.

How to attach a site thumbnail from user submitted links in a facebook application

The Facebook application I had in mind has users submit links from sites. I would like there to be a thumbnail of the site, similar to what happens when you post/message someone a link and a thumbnail automatically shows up. Any thoughts on how to go about doing this?
The sites you link to need to have Open Graph tags (https://developers.facebook.com/docs/opengraph/) on their pages to set the default image, description and title for this to happen. If those meta tags are not set, the first image on the page will be the default along with other generic information Facebook is able to scrape from the page.
If you want to test out a few pages and see what information they have set, use Facebook's URL lint tool (https://developers.facebook.com/tools/debug). Simply copy and paste any URL in there.

How to recreate an image preview from outside websites?

Similar to Facebook's UI, I am attempting at generating a preview image from an external linked website. So that when a user types in a url he is linking, the UI will by default, scan that site for an img and scrape a preview thumb.
Is there a specific name for this technique? Or can anyone point me in the direction of learning this?
Thanks so much!
Its called scraping. There is a library called scrAPI.
Here is a code example http://crunchlife.com/articles/2007/08/13/code-snippet-ruby-image-scraper
There are a couple different options when it comes to page scraping. Another one to check out would be nokogiri, http://nokogiri.org/. You can find tutorials on how to use it at http://nokogiri.org/tutorials.
Instead of grabbing an image from the site, why not grab the image of the entire page? You could make use of a free screenshot service like http://www.websnapr.com/ or http://www.thumbshots.com/ among others. In one application, I use that for my preview image, and use nokogiri to scrape the page title and description. Just an idea.

Resources