How to Fetch all images attached to a single facebook post? - image

I want to programmatically fetch all the images attached to a single facebook post. Is there a way to fetch all the images associated with a facebook post by using code? For eg i will pass the post url, and the images , lets say 10, all will get downloaded, or atleast capture their urls. Right now, the visible image url in the source code behind are only 4 images. The rest goes into a carousel on which we browse by clicking next.
for eg this fb post has over 47 images. in the main post, only the first 4 load. how do i get the rest of the images that are attached to this post
https://www.facebook.com/permalink.php?story_fbid=pfbid0qDrdWitZ8MG9Tr3nHLr9aY25TvKg6cEdYsULHDda9VsaJLQcFhHUJnauaqE9rrJwl&id=372414323284192

Related

Extract image link from TinyMCE in Laravel

I'm making an image sitemap for my site I'm trying to extract the image link from the post and I'm using the TinyMCE text editor Need Help pls.
I use this code but the problem is I do this in the controller and I can't do it in the view This code being in the Controller leads to two problems, first, that I will not be able to all the images for one post, but I have to fetch the images of all posts together at once. The second thing or the second problem is that this code extracts the images twice: the link I want and the link inside So I want a solution so that I can extract images for one post
Below is a picture of the code in the controller

Google Sheet & App Script : how to get image from a link preview?

I am trying to reproduce a RSS reader like Feedly with Google Sheet and displaying with Glide as an app on my mobile phone.
Everything's fine with IMPORTFEED() function with titles, description, URL.
But it seems this function doesn't allow pictures to be displayed even if they are in the feed (which is not all the time).
So I am looking for a way to extract the main image from a blog post... the one displayed when you hover on a link in a Google Sheet cell.
I would like to get the link of that image displayed in the link preview and put that link in another cell.
Here is an example:
I tried IMAGE()
and also IMPORTXML when there is an image in the RSS feeds (but not all of them do... so I stopped)
Is it possible in Google Sheet to get the main image from the one displayed in the link preview ?
For instance, one of the blog I want to extract the main picture of a blog article would be Creajv (URL : https://creajv.com/ ; Feed : https://creajv.com/feed/)
So the IMPORTFEED() function I did in Google Sheets was :
=IMPORTFEED("https://creajv.com/feed/";"items";FALSE;3)
Which stands for :
=IMPORFEED(...) the function to import feeds from an URL
"items" the way to pull every data there is in the feed (you can use other parameters and can see all the possibilities on the GoogleFormulas documentation)
FALSE because I don't want the headers to be included
and the number 3 because I want only the last 3 results displayed.
And it displays perfectly : author, description, URL, date
But I did a little digging in Google and found that basically IMPORTFEED() cannot get images from feeds, even if it is added by the author of the blog (he has to add a feature to do it).
So I am now trying to see if there is another way which is not IMPORTFEED() to get every time the main image of a blog post.
And I saw Google Sheet is able to pull instantly it when I copy paste the URL of a blog article within a cell for instance for Creajv :
Print screen of the image I get when I click in the cell which contains the post URL
So my thoughts would be that I can pull the author, date, description etc. with IMPORTFEED (which works perfectly every time) and use a formula on the cell with the URL to get in another cell the URL of the picture pulled from the one in the link preview.
Two other possibilities might also be with Google App Script :
creating with the App Script a custom function
or creating a script pulling the image in a cell every time a new row is added via the IMPORTFEED() function.
Functions only, as Apps Script doesn't run on mobile Apps
How about this solution? I checked the website and inspected the image from the thumbnail.
Luckily, the structure is simple:
<div class="article-image">
<img src="https://creajv.com/wp-content/uploads/2020/11/HighresScreenshot00000.png" alt="Concours de Level Design avec Unreal Engine, du 11/11 au 05/12/2020">
</div>
You can get the url with IMPORTXML, and apply IMAGE to it:
=IMAGE(ImportXml("https://creajv.com/2020/11/08/concours-de-level-design-avec-unreal-engine/", "//div[#class='article-image']//img/#src"))
Since you are already retrieving the post url with your previous formula, change the source url by the correspondent cell:
=IMAGE(ImportXml(C1, "//div[#class='article-image']//img/#src"))
For example:

How to set open graph image, after load the page without og image and call the image by AJAX

After load the article/page, I then make ajax call to get the article images from API, So the images of article get loaded after page load (and that's because bring them take long time), Now I want to make the returned image as og:image value.
See as an example this page for specific car:
http://arabiauto.com/Autos/Details/63577
How make the facebook share show the image of car (that come by ajax after load page)?
Any help please?

Fetch image from server and render it in

I want to fetch image from the server, save it locally and and display when user opens the show page - with Rubymotion.
I am using AFMotion to fetch the image url as follows.
In my show screen I can get the image url with news.image_url. My doubt is how do i pass this to the layout file where I can add some styles to it like
I have found a solution to my own question. This is what i have done.
In the on_load method of the show news page, I pass the image url and set the remote_image for the UIImageView to the image url passed.
I got the solution from the red potion documentation. http://docs.redpotion.org/en/latest/cookbook/networking/

facebook API - batch requests to one request to get image dimensions

i am reading the whole public feed of an user with facebook graph api.
the way i get the feed is:
https://graph.facebook.com/userid/feed
so, in this feed sometimes there are posted pictures which i also want to use in my app. problem is:
when i just load the image source, i am getting a very low quality image.
with facebook graph api it is possible to get image dimensions when i have the object_id of the picture/photo like this:
https://graph.facebook.com/objectid?fields=images
with this call i am getting the image with all dimensions and imagesource URL.
but for this i have to call a request again. how can i batch that together so that i can get the feed WITH the imagesTAG directly in first call?
i have tried to call first and second level but i didnt get any solution:
https://graph.facebook.com/userid/feed?id,name,message,object_id,picture,type{images}
anyway, i tried so much but i cant get the image resolutions with ONE call in that json return.
is this not possible with the graph api? or what i am doing wrong here?
thanks,
brush51
Use this complex batch request to retrieve images (replace "me/home" with your request):
[{ "method":"GET","name":"me_home", "relative_url":"me/home?fields=object_id"}, { "method":"GET", "depends_on":"me_home", "relative_url":"?ids={result=me_home:$.data.*.object_id}"}]
But note that you will get only images hosted at Facebook.

Resources