[PHP/OOP] 4chan image downloader V2

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Fuck you, I'm a dragon Pieman is offline
    The OmegaRank
    Apr 2005 Join Date
    The NetherlandsLocation
    7,582Posts

    [PHP/OOP] 4chan image downloader V2 !UPDATED!

    This is the next version of 4chan Image downloader I've added a gallery which let's you select which images you want to download. So you don't accidentally download 20 furry porn wallpapers to your server.

    Requirements:

    • PHP 4.0 or higher (5.0 or higher recommended)
    • A web server which let's you edit ini settings.


    Screenshots:



    How to use:

    Put the script anywhere on your web server, call it "4chan_images.php" then create a directory called "images" (This can be changed). Then run the script and everything should be self-explanatory.

    Script:

    PHP Code:
    <?php
    error_reporting
    (0);

    class 
    image_downloader 

        public 
    $url;
        
        protected function 
    get_source() {
        
            if((
    $source = @file_get_contents($this->url)) == false) {
            
                die(
    "Could not open thread.");
            
            }
        
            return 
    $source;
        }
        
        protected function 
    get_file_link() {
        
            
    $source $this->get_source();
            
    $i 0;  
                
            
    preg_match_all("/\"\>File(.*?)\<blockquote\>/is"$source$matches_image);
            
            while(
    $i count($matches_image[1])) {
            
                
    preg_match("/\<a href\=\\\"(.*?)\\\" target\=/is"$matches_image[0][$i], $images_array[$i]);
                        
                
    $i ++;
                
            }
                        
            return 
    $images_array;
                    
        }
        
        public function 
    get_images() {
        
            
    $a_images $_POST['amount'];
            
    $i 0;
            
            while(
    $i $a_images) { 
            
                if(isset(
    $_POST["image_$i"])) {
                
                    
    $images_array[$i] .= $_POST["image_$i"];
                }
                
                
    $i ++;
                
            }
            
            return 
    $images_array;
            
        }
        
        public function 
    save_file() {
        
            
    $images_array $this->get_images();
            
    $i 0;
            
    $errors 0;
            
    $file "";
            
            while(
    $i count($images_array)) {
            
                
    $extension preg_replace("/.*\./is"""$images_array[$i]);
        
                if((
    $handle_external = @fopen($images_array[$i], "r"))) {
                
                    while(
    $line fread($handle_external8192)) {
                    
                        
    $file .= $line;
                        
                    }
                    
    //Change the directory between quotes to change the directory the images will be downloaded to.
                    
    while(($handle_internal fopen("images/".rand(0,9999999999999).".$extension""x+"))== false)
                    
                    
    fclose($handle_external);
                    
    fwrite($handle_internal$file);
                    
    fclose($handle_internal);
                    unset(
    $handle_external$line$file$handle_internal);
                    
                } else {
                
                    
    $errors ++;
                    
                }
                
                
    $i ++;
                
            }
                
            echo 
    $errors " image(s) not saved.<br/><br/><a href='".$_SERVER['PHP_SELF']."'>&lt;&lt;back</a>";
            
        }                
    }
    class 
    display_images extends image_downloader {

        public 
    $url;

        private function 
    get_thumbs() {
        
            
    $source $this->get_source();
            
    $i 0;  
                
            
    preg_match_all("/\"\>File(.*?)\<blockquote\>/is"$source$matches_image);
            
            while(
    $i count($matches_image[1])) {
            
                
    preg_match("/img src=([a-z0-9:\/\.]*)/is"$matches_image[1][$i], $thumbs_array[$i]);
                        
                
    $i ++;
                
            }
            
            return 
    $thumbs_array;
                    
        }
        
        public function 
    d_img_form() {
        
            
    $thumbs_array $this->get_thumbs();
            
    $images_array $this->get_file_link();
            
    $i 0;
            
    $thumbs "";
            
            echo 
    '<form name="image_form" method="post" action="4chan_images.php">';
            echo 
    "\n";
            echo 
    '<table cellspacing ="5" border ="0" align="center">';
            echo 
    "\n";
            
            while(
    $i count($thumbs_array)) {
            
                if(
    $i == 0) {
                
                    
    $thumbs .= "<td><div style='width:130px; height:130px; background-color:#000000;' align='center'><input type='checkbox' checked='checked' name='image_$i' value='".$images_array[$i][1]."' style='float:right;'/><a href='".$images_array[$i][1]."' target='_blank'><img src='".$thumbs_array[$i][1]."' alt='Thumbnail $i' height='100px' width='126px' border='0'/></a></div></td>\n";
                } else {    
            
                    
    $thumbs .= "<td><div style='width:130px; height:130px; background-color:#000000;' align='center'><input type='checkbox' checked='checked' name='image_$i' value='".$images_array[$i][1]."' style='float:right;'/><a href='".$images_array[$i][1]."' target='_blank'><img src='".$thumbs_array[$i][1]."' alt='Thumbnail $i' style='max-height:115px;' border='0'/></a></div></td>\n";
                            
                    if(((
    $i+1) % $_POST['images_row'] == 0) || (count($thumbs_array) - $i == 1)) {
                        
                        echo 
    "<tr>\n";
                        echo 
    $thumbs;
                        echo 
    "</tr>\n";
                                    
                        
    $thumbs "";
                    }
                }
                
    $i ++;
            }
            
            echo 
    "</table>";
            echo 
    "<input type='hidden' name='amount' value='".count($thumbs_array)."'/>";
            echo 
    "\n <br/> \n";
            echo 
    '<div align="center"><input type="submit" name="download" value="download"/></div>';
            echo 
    '</form>';
                
        }
    }        
        
    set_time_limit(0);
    ini_set("max_execution_time""0");

    if(!isset(
    $_POST['get_thread']) && !isset($_POST['download'])) {

        
    ?>
        <form method="post" action="">
        Link to thread:<br/>
        <input type="text" size="55" name="link" />
        <br/>
        Amount of images per row
        <select name="images_row">
        <option value="10">10</option>
        <option value="9">9</option>
        <option value="8">8</option>
        <option value="7">7</option>
        <option value="6">6</option>
        <option value="5">5</option>
        <option value="4">4</option>
        <option value="3">3</option>
        <option value="2">2</option>
        <option value="1">1</option>
        </select>
        <br/>
        <input type="submit" value="submit" name="get_thread" />
        </form>
        <?php
        
    } else if(!isset($_POST['download'])) {

        
    $display = new display_images();
        
    $display -> url $_POST['link'];
        
    $display -> d_img_form(); 
        
    } else {

        
    $downloader = new image_downloader();
        
    $downloader -> save_file(); 

    }
    ?>
    If you encounter any bugs, please post them here and I'll try to fix them.

    10-10-09: Updated the script, it now works again with all boards. It now also downloads the first image of every thread. Something the previous script didn't. Sorry it took so long.
    Attached Images Attached Images
    Last edited by Pieman; 16-10-09 at 09:37 AM.
    TO ALL SEXY MEN SENDING ME FRIEND REQUESTS: I DO WANT TO KNOW YOU AND I WANT TO BE YOUR FRIEND. FUCK ME.


  2.  
  3. #2
    Account Inactive Cask is offline
    InactiveRank
    Jul 2007 Join Date
    890Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Thank you, kind sir!

  4. #3
    :) Horizon is offline
    Alpha MaleRank
    Jan 2009 Join Date
    Illinois, U.S.Location
    2,408Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Yay. Now I can has my CP without going to 4chan!

  5. #4
    Account Inactive RastaLulz is offline
    InactiveRank
    Dec 2007 Join Date
    EarthLocation
    3,424Posts

    Re: [PHP/OOP] 4chan image downloader V2

    EDIT:
    I get this error (cut most of it out, as it just keeps going):
    Spoiler:

    Warning: fopen(http://forum.ragezone.com/images/1231557360.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fopen(http://forum.ragezone.com/images/1057467094.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/155272629.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1302480645.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/313769124.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1284281773.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1224554075.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/803840865.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/183298859.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/620502664.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/827122343.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1144948452.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/447014245.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/228927755.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/957838674.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1240111155.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/373707797.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/458845759.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1027499656.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/771991171.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/525457841.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/545948870.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/952255751.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/946560081.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/885259376.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1241851128.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1075727281.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/597348005.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/100885000.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/485501204.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/894793242.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/149357804.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/441168312.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1210086757.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1201313926.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/930353098.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/705887364.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/353684963.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1080417580.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/494662297.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/114535030.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/533831215.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/960195144.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/411181887.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/673270827.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/289079470.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/514106299.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/845810821.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/781306574.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/408946110.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1295449843.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1029980198.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/481323632.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/675401954.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/285130141.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/993384451.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/570665700.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/838556004.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/9635530.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1298209213.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/204853762.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1232885278.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/360016702.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/84661853.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/207734052.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1036704544.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/404250197.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1269059853.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/914622255.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/119300948.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/323280556.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/328548306.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/469745044.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/1166790340.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/177173665.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/970125418.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/810317116.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/918153208.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/116220436.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/170772757.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/946784065.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/109741947.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/52495455.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76

    Warning: fopen(http://forum.ragezone.com/images/160563504.jpg) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 74

    Warning: fclose(): 2 is not a valid stream resource in /home/rasta21/public_html/foskett.ws/4chan/4chan_images.php on line 76


    I've tried it on localhost, and my webhost, neither work.

  6. #5
    Account Inactive Mr.Lucifer is offline
    InactiveRank
    Apr 2007 Join Date
    1,096Posts

    Re: [PHP/OOP] 4chan image downloader V2

    It's very nice.

    I got the same error as you, Rasta. I can't remember exactly how I fixed it but it had something to do with PHP permissions... Either that or I installed another webserver software, WAMP that is.

  7. #6
    Fuck you, I'm a dragon Pieman is offline
    The OmegaRank
    Apr 2005 Join Date
    The NetherlandsLocation
    7,582Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Quote Originally Posted by Rasta View Post
    EDIT:
    I get this error (cut most of it out, as it just keeps going):

    I've tried it on localhost, and my webhost, neither work.
    It seems php can't open the folder where the images are saved in. Try to chmod the folder to 777. If that doesn't work change
    PHP Code:
    while(($handle_internal fopen("http://forum.ragezone.com/images/".rand(0000000000001,9999999999999).".$extension""x+"))== false
    on line 74 to
    PHP Code:
    while(($handle_internal fopen("".rand(0000000000001,9999999999999).".$extension""x+"))== false
    This will save all the images in the same folder as the script is located.

    As Mr. Lucifer said, it has to do something with permissions. I'm unsure how to fix it though, other than the methods I named above.
    TO ALL SEXY MEN SENDING ME FRIEND REQUESTS: I DO WANT TO KNOW YOU AND I WANT TO BE YOUR FRIEND. FUCK ME.

  8. #7
    Account Inactive RastaLulz is offline
    InactiveRank
    Dec 2007 Join Date
    EarthLocation
    3,424Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Quote Originally Posted by Pieman View Post
    It seems php can't open the folder where the images are saved in. Try to chmod the folder to 777. If that doesn't work change
    PHP Code:
    while(($handle_internal fopen("http://forum.ragezone.com/images/".rand(0000000000001,9999999999999).".$extension""x+"))== false
    on line 74 to
    PHP Code:
    while(($handle_internal fopen("".rand(0000000000001,9999999999999).".$extension""x+"))== false
    This will save all the images in the same folder as the script is located.

    As Mr. Lucifer said, it has to do something with permissions. I'm unsure how to fix it though, other than the methods I named above.
    Thanks, it now works perfectly.

    Also, when I tried to chmod it to 777 yesterday, it gave me the 500 error.

    But anyways, that fix worked.

  9. #8
    Fuck you, I'm a dragon Pieman is offline
    The OmegaRank
    Apr 2005 Join Date
    The NetherlandsLocation
    7,582Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Quote Originally Posted by Rasta View Post
    Thanks, it now works perfectly.

    Also, when I tried to chmod it to 777 yesterday, it gave me the 500 error.

    But anyways, that fix worked.
    Glad to help
    TO ALL SEXY MEN SENDING ME FRIEND REQUESTS: I DO WANT TO KNOW YOU AND I WANT TO BE YOUR FRIEND. FUCK ME.

  10. #9
    Don't you mean Bizzarro! Ambrosiax is offline
    True MemberRank
    Apr 2008 Join Date
    1,349Posts

    Re: [PHP/OOP] 4chan image downloader V2

    This is probably a small problem I keep getting.

    Code:
    Notice: Undefined variable: i in C:\wamp\www\IMAGES\4chan_images.php on line 23
    
    Notice: Undefined variable: images_array in C:\wamp\www\IMAGES\4chan_images.php on line 31
    0 image(s) not saved.
    Whats that mean?
    Theres no images? o.O

  11. #10
    Fuck you, I'm a dragon Pieman is offline
    The OmegaRank
    Apr 2005 Join Date
    The NetherlandsLocation
    7,582Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Quote Originally Posted by Ambrosiax View Post
    This is probably a small problem I keep getting.

    Code:
    Notice: Undefined variable: i in C:\wamp\www\IMAGES\4chan_images.php on line 23
    
    Notice: Undefined variable: images_array in C:\wamp\www\IMAGES\4chan_images.php on line 31
    0 image(s) not saved.
    Whats that mean?
    Theres no images? o.O
    It's just an empty variable. Just add error_reporting(1); add the top of the file and it should be fixed.

    Or better yet, add
    PHP Code:
     $i 0
    under
    PHP Code:
    $source $this->get_source(); 
    On line 19.
    TO ALL SEXY MEN SENDING ME FRIEND REQUESTS: I DO WANT TO KNOW YOU AND I WANT TO BE YOUR FRIEND. FUCK ME.

  12. #11
    Account Inactive john_d is offline
    InactiveRank
    Feb 2004 Join Date
    PhilippinesLocation
    2,973Posts

    Re: [PHP/OOP] 4chan image downloader V2

    im more interested in a CSS image downloader
    Dekaron UI v2 | Maple Portal | MUToolz Multi Server Edition | CabalToolz V4

    On Twitter "http://twitter.com/mmowebs"
    Portfolio: http://www.mmowebs.com/

  13. #12
    Fuck you, I'm a dragon Pieman is offline
    The OmegaRank
    Apr 2005 Join Date
    The NetherlandsLocation
    7,582Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Quote Originally Posted by john_d View Post
    im more interested in a CSS image downloader
    Like a script that downloads all images from a CSS file? That does sound useful indeed... Maybe an idea for my next project.
    TO ALL SEXY MEN SENDING ME FRIEND REQUESTS: I DO WANT TO KNOW YOU AND I WANT TO BE YOUR FRIEND. FUCK ME.

  14. #13
    :-) s-p-n is offline
    Alpha MaleRank
    Jun 2007 Join Date
    Next DoorLocation
    2,050Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Quote Originally Posted by Pieman View Post
    It seems php can't open the folder where the images are saved in. Try to chmod the folder to 777. If that doesn't work change
    PHP Code:
    while(($handle_internal fopen("http://forum.ragezone.com/images/".rand(0000000000001,9999999999999).".$extension""x+"))== false
    on line 74 to
    PHP Code:
    while(($handle_internal fopen("".rand(0000000000001,9999999999999).".$extension""x+"))== false
    This will save all the images in the same folder as the script is located.

    As Mr. Lucifer said, it has to do something with permissions. I'm unsure how to fix it though, other than the methods I named above.
    Actually it's because it says http://forum.ragezone.com/images/ instead of ./images.

    If you just replaced the http://forum.ragezone.com part with a [.] it should be fine.

    Ragezone glitch hurts sometimes
    If you like my content here, please comment on my blog.

  15. #14
    Fuck you, I'm a dragon Pieman is offline
    The OmegaRank
    Apr 2005 Join Date
    The NetherlandsLocation
    7,582Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Quote Originally Posted by s-p-n View Post
    Actually it's because it says http://forum.ragezone.com/images/ instead of ./images.

    If you just replaced the http://forum.ragezone.com part with a [.] it should be fine.

    Ragezone glitch hurts sometimes
    That glitch is dreadfully annoying yes, though I believe the poster was aware of this.
    TO ALL SEXY MEN SENDING ME FRIEND REQUESTS: I DO WANT TO KNOW YOU AND I WANT TO BE YOUR FRIEND. FUCK ME.

  16. #15
    Isenheart . Leimone is offline
    True MemberRank
    Jul 2008 Join Date
    Sweden, Stockholm.Location
    1,358Posts

    Re: [PHP/OOP] 4chan image downloader V2

    Goodjob, thanks.


  17.  

    Latest Gaming Releases

Page 1 of 2 12 LastLast

Advertisement