Consider an example page like this
Now, it displays all the image thumbnails. I click on the thumbnail and then I right click on larger version of image and copy the image location. Is there any way to do it programmatically. I have tried to use goutte to extract links after scraping webpage but it does not extract any link may be because the page is generated dynamically.
Is there some other way to do it?
$crawler = $client->request('GET', 'https://www.facebook.com/TedTheStoner2/photos_stream');
$crawler->filter('.uiMediaThumb')->each(function ($node)
{
echo $node->attr('href').'<br>';
});
You really should use the facebook graph api for reading those pictures.
That way you will be able to get a complete list of images and then read every single image for more details.
You will not be able to crawl the picture gallery the way you've tried without using a javascript-enabled solution as the pages are rendered by JS on pageload.
Related
I'm making a simple website (think of it as wikipedia without the text), where the users click links to people's names and then go to that person's personal page. I would like to be able to have an image of the person also show up on the personal page, but I don't want to hard code the links to the images or save them on my computer.
Is there a way that I can get the top search result from Google images and then copy that link to put into each page dynamically?
I would suggest using the google api (Google image search api ), pull a search on page load for the user, parse the json for the "unescapedUrl" and use that as your img src attribute.
I have a question regarding watermarks for images. For instance: I want to display an image (pure HTML). If a user clicks on the image however, there should be a watermark, showing where that photo comes from.
I was thinking about a layer-solution. Putting an invisible layer over the main image and link to another image instead. That would force me to have every photo two times on my server. Not the best idea.
I found a lib called watermark.js (link here: watermark.js).
However, this would only allow me to put watermarks right in the beginning.
To explain the situation: User on my site sees everything without watermark, opening it directly in the browser should add the watermark.
Another solution I had was to always apply a watermark via script, and remove it if the user is currently on my site.
Maybe you have a solution to apply watermarks only on the linked images. I'd like to realize it via jquery.
Thank you in advance.
I'm currently working on a website that will have lots of pictures, using mostly only javascript and HTML. My website is going to have lots of images displayed on the home page, and when one is clicked on it will take the user to a page where it shows the image they clicked on, along with a share to Facebook button, a comments section, and a description.
The problem is my site is going to have a lot of image, and it would take forever to create a separate html file for every single one of those images. I do realize I could easily do this with javascript, however i really need each image to have a different url so that the share to Facebook button will work.
I looked at some other picture websites, and 9gag had exactly what i wanted on my site, each image had a number assigned to it in the url, whenever i clicked the next button all it did was change the number at the end of the url, except with 9gag the images are uploaded by users, so the site must somehow create another url each time someone uploads a new image, and I'm looking for a way to do this except I'm the one choosing all of the images.
Generally , the number in the URL is the the ID of the post stored in the database. These numbers are automatically assigned (assuming your ID is auto increment)
Index your picture's names into an array then post the variable in the url so that the page will display that image. Like showimage.html?image_path=picture1
I have a webpage i keep adding a like button app to but whenever i click like i get some random member phot of a lady on facebook representing my page. this is frustrating.
I find all this html script and i cant seem to put it together properly so will you just please give me a simple paste ready like button formula with a set specific thumbnail photo that I can choose to represent my own page?
Use the open graph properties for your webpage defined here:
http://developers.facebook.com/docs/opengraph/
I'm trying to create a comic book reader using JavaScript where the content of the gallery is dynamically generated from the images in a given directory (directory is chosen with a bit of PHP). I want to display two pages (images) at a time so the comic is read like it would be in a book format. Users are then able to navigate two pages at a time with their arrow keys.
So far I can only get one page to load and view at any given time.
How can I do this? I don't want to have to hard-code every gallery.
Maybe you could generate a directory listing with PHP and put it into the javascript on the page?