Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 07:02

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Aktuelles Bild von Website (Script)

Discussion on Aktuelles Bild von Website (Script) within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 329
Join Date: Jan 2010
Posts: 6,047
Received Thanks: 1,741
Aktuelles Bild von Website (Script)

Hallo,

suche nach einem Script (Java/PHP) welches mir ein Bild von einer beliebeigen Seite liefert. Muss ein Script sein, da es sich um sehr sehr viele Bilder handelt.

Danke,
nohawx
No Hawx is offline  
Old 08/03/2012, 20:16   #2
 
kissein's Avatar
 
elite*gold: 0
Join Date: Sep 2005
Posts: 427
Received Thanks: 87
kein sexy code aber naja keine lust das jetzt zu korrigieren, aber funktioniert bzw. prinzip ist verwendbar


PHP Code:
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
                  
            
if(!empty($_POST['url'])){
                
                
$url trim$_POST['url']);                
                
$html = @file_get_contents($url);
                
preg_match_all('/<img[^>]+>/i',$html$result);                
                
$img = array();
                
                foreach( 
$result[0] as $img_tag)
                    
preg_match_all('/(src)=("[^"]*")/i',$img_tag$img[$img_tag]);

                foreach(
$img as $value => $key)
                {
                   
$imagepath str_replace('"'''$key[2][0]);
                   
$fullpath basename($imagepath);

                    if(
strpos($fullpath"empty.gif") === false && stristr($fullpath"?")=== false){
                        
                        
$ch curl_init($imagepath);
                        
curl_setopt($chCURLOPT_HEADER0);
                        
curl_setopt($chCURLOPT_RETURNTRANSFER1);
                        
curl_setopt($chCURLOPT_BINARYTRANSFER,1);
                        
$rawdata=curl_exec($ch);
                        if(
strpos($rawdata,"Not Found") === false) {
                            if(
file_exists($fullpath))
                                
unlink($fullpath);

                            try {
                                
//Bild speichern
                                
$fp fopen($fullpath,'x');
                                
$check $fp;

                                if(isset(
$check)){
                                    
fwrite($fp$rawdata);
                                    
fclose($fp);
                                }
                                else
                                    
fclose($fp) or die("fclose");
                            }
                            catch (
Exception $e) {
                                echo 
'Exception abgefangen: ',  $e->getMessage(), "\n";
                            }
                         }
                         else
                            echo (
"Fehler");

                        
curl_close ($ch);
                    }
                    unset(
$img);
                    unset(
$value);
                    unset(
$key);
                }
        
?>
        <form action="<?  $_SERVER['PHP_SELF'?>" method="post">
            url: <input type="text" name="url" value="" />
            <input type="submit" name="submit" />
        </form>
    </body>
</html>
//edit: so mal unnötiges zeug entfernt. das script zieht alles innerhalb einer img src verlinkt ist. es fehlt noch eine mime_type überprüfung, aber kann man ja erweitern
kissein is offline  
Thanks
2 Users
Old 08/04/2012, 12:37   #3
 
elite*gold: 329
Join Date: Jan 2010
Posts: 6,047
Received Thanks: 1,741
Danke, ich werde es mir mal anschauen.
No Hawx is offline  
Reply


Similar Threads Similar Threads
looking for good website script
12/15/2011 - SRO Private Server - 5 Replies
Hello.. i search many times around google and elitepvpers. and i just got this script http://www.elitepvpers.com/forum/private-sro-main -discussions-questions/170360-private-sro-webscrip t.html and wrong download link ... i just want new download link or good script for my pvt sro.. thanks brother's..
Ich suche ein gewisses homepage script hier das bild.
02/19/2011 - Metin2 Private Server - 7 Replies
Ich suche das script pls dl link. http://img220.imageshack.us/img220/87/61873320.pn g
script for website
04/09/2010 - Zero - 9 Replies
my server is online. someone has the site with the script's to create accounts
Website script
11/08/2009 - Metin2 Private Server - 8 Replies
Können Sie mir den Link auf die Rede-Skript metin2 für pvp
[Help] Df script for website
08/18/2009 - Dekaron Private Server - 26 Replies
im looking for a df timer to put on a website so people can see when the df timer is on etc



All times are GMT +1. The time now is 07:03.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.