Archive for December, 2007

PHP function to look for images

December 16th, 2007 | Category: Computers, HowTo, Internet, PHP, Programming, Websites

The function below will look for numerically numbered images (or any other type of file) on any giving website. The function will echo weather or not it found anything, if it found something it will return the html image code(s) for it.

/*When calling the function $istop should equal 1. $name should equal the name you want to echo. $imgurl should equal the image url until the number (if you had http://naterocks.com/image1.gif then the url would be http://naterocks.com/image), $ext should equal the file extension (you do not have the put a “.”, in the example above this would mean that $ext=”gif”), $number equals the number that you want to start searching from, $nwe is how many images you want per line, and $nwt should equal 1 when being called.*/

//to call use $variable=look_image(1,$name,$imgurl,$ext,$number,$nwe,1); 

 function look_image($istop,$name,$imgurl,$ext,$number,$nwe,$nwt)
{

$url=$imgurl.$number.”.”.$ext;
if( !fopen($url, “r”) )
    {
      if ($istop==1)
       {$nwf=0;}
      echo ($name.” searching ended on number:”.$number.”<br>”);
    }
    else {
    if ($istop==1)
     { echo (”<b>New “.$name.”(s) found!</b>”);
     $post=”\n\n[b]New “.$name.”(s):[/b] \n”;
      }
    echo(”<br><img src=’”.$url.”‘><br>”);
    if ($nwe!=$nwt)
    { $post=$post.”<img src=’”.$url.”‘>”; }
    else
    { $post=$post.”<img src=’”.$url.”‘> \n”;
    $nwt=0; }
         //some math
    $number++;
    $nwt++;
    //keep looking
    $nwf=$post.look_image(0,$name,$imgurl,$ext,$number,$fname,$nwe,$nwt);
    }
 return $nwf;
}

No comments

Big media companies fight legal torrent tracking with crime

December 02nd, 2007 | Category: Internet, Life, Politics, Programming, Software, Stuff, Websites

In Sweden digital piracy is legal. Coincidently one of the biggest torrent trackers is a Swedish website, a torrent tracker is a website that links you to torrents that then tell your computer where to get a file from. So basically a torrent tracker does not actually have any pirated content on it, it just tells you where to get the content from.

That being said, it becomes very hard for big media companies to shut down torrent trackers in Sweden legally. So that means that companies such as, Twentieth Century Fox, Universal Music Group, Universal Pictures, Paramount Home Entertainment, Atari, Activision, Ubisoft, and Sony Bmg Music Entertainment now have to resort to illegal methods to shut down completely legal sites that get rid of their advantages. What these companies did is they hired professional hackers to try and hack the swedish site ”The Pirate Bay“(tpb) and unfortunately tpb has had to file charges against those companies. Their blog post about it is here.

1 comment