Jump to content

beba

New Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About beba

  • Rank
    Newbie
  1. okay firstly yes, i can take my own photos (in fact i already have), however for the purposes of my project i need the ratings of the photos as much as i need the photos themselves (without the rating the photo is pointless). and yes "nothing special", "seen that a hundred times already" photos will suit me just fine (in fact thats EXACTLY what i need), however again, without the ratings theyre meaningless also, as i require literally thousands of photos the idea of spending hours manually quickly on each one is pretty ridicules, in fact one member of our group has spent over a week putting together 200 photos and it has been very time consuming after over 2 hours on google this is pretty much the only site ive found that allows users to upload photos and rate others, then averaging the ratings together (Something that is crucial to the project), if anyone knows of any other sites that do not have a disclaimer then please let me know, id literally love nothing more i had not seen the disclaimer until joel24 posted it, tbh i never even thought of checking. so your comment is irrelevant as i asked before i knew anything was even wrong. this is an assignment to me, period. one im working hard to get through. meeting with my lecturer tomorrow so ill let him know of your opinions, however since hes already approved this site i think he wouldve already seen the disclaimer himself either way, the fact remains, i need a script for the project (whether or not it will actually be used this semester is uncertain) and will continue working on it any help on the script will be appreciated, any derogatory comments regarding me or my "claimed purposes" will be ignored, the script can easily be adapted to work on other sites (in theory) and probably will be when another group takes over this assignment next semester (provided they can find another site that meets the criteria) thank you
  2. btw, just an update, continuing to work on the script, and have made progress on the first part, was able to use a program to create an XML sitemap of photo.net, so now all i need is to loop through the XML file to get urls from it, this i believe i can do on my own, so no longer need help with step 1 still stuck on 2 & 3 though
  3. yet its okay to view them? and you can download them by clicking on the image and selecting save as either way i do not plan on publicizing them or using them for any profit making purpose what i intend to do with them is a long story (involves a deep learning package and the question "can a computer distinguish between a good photo and a bad one?"), however it is nothing nefarious, these photos will not be used in any public way, nor any way that would be much different from viewing them on the webpage itself
  4. Hi ive got a project im working on where i need to collect a whole bunch of images from a website (photo.net) and decided a PHP script might help automate the process. A few other people may work on the project in the future so im leaving detailed comments on most lines to help them understand the code so far im stuck with a few aspects of the coding process: 1. I have a URL, but need to know how to open a random page on that URL, specifically a page with a picture on it, such as http://photo.net/photodb/photo?photo_id=18012098, i have thought about using "http://photo.net/photodb/photo?photo_id=" as the URL and randomly generating an 8 digit number at the end, but manually tested it out and there are alot of combinations that result in an error page (such as http://photo.net/photodb/photo?photo_id=10012098), so would need a method more reliable. 2. As far as the file name ill be using goes theres certain criteria, ill need the name of the photo, the rating and the number of votes (all of which are located in the details tab of each photo), these details are combined to create a file name, in the example of the following photo http://photo.net/photodb/photo?photo_id=18012098, the filename id need the generate would be something like "Chameleon Snatches Hornworm 6.23 13.jpg" Im having trouble figuring out how to get my php script to scan a page for info and store it in a variable 3. and finally i need to know how to actually rip the image from the page, saving it under the $foldername and #filename variables the code ive written so far is below, any help i can get on any of these 3 issues would be very much appreciated thank you, function download_image { //File Path variable, change to path you wish to download files to (be sure to end with a slash "\") $folderpath = "E:\Pictures\"; //Website Variable, Change to the website youre downloading photos from $url = "http://photo.net/"; //Number of Photos, change variable to indicate the number of photos you wish to download at any one time $photos=10; //Main Loop, this will find photos in the URL, assign a file name and save the photo to the specified file path for ($i = 0; $i <= $photos; $i++) { //Opens picture random picture from URL // Assigns filename // Gets the name of the picture (adjust if using a website other than photo.net) $picturename = ; // Gets the rating of the picture (adjust if using a website other than photo.net) $rating = ; // Gets the number of votes for the picture (adjust if using a website other than photo.net) $votes= ; //combines all these variables to create the filename $filename= $picturename . " " . $rating . " " . $votes . ".jpg"; //checks rating, if "critique only" then move on to another photo if ($rating = "Critique Only") { //if no proper rating deduct 1 from $i i--; } else { //Checks Folder to see if file already exists (if so, it deducts one from $i variable, this will ensure that the right number of photos are downloaded without downloading doubles) $filepath = $folderpath . $filename; if (file_exists($filepath)) { //if file exists deduct 1 from $i $i--; } else { //if file doesnt exist download picture to folder } } } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.