PHP hotlinking simulation?

Discussion in 'PHP' started by jumpjack, Feb 5, 2010.

  1. #1
    I don't know if "hotlinking simulation" is actually what I need: I want to download images from this address (*):
    http://www.sat24.com/image.ashx?sat=vis&type=history&country=it&time=201002050900&sessionid=lu5gewaraqfnw0igmbcb5tuh


    Such addresses actually show images if hotlinked, but calling them by using Curl results in an error page. Can Curl behave in such a way linked server "thinks" it's an hotlinking?

    Or, how else can I get those images and save them on my server? (I'd like to build an animated gif, or at least a TAR archive).

    (*)This link will not work for you until you replace sessionid with a new one, which you can obtain by accessing the page in a standard manner:
    http://www.sat24.com/history.aspx?country=it

    Drag the image to the address bar to show its address with proper sessionid.
     
    jumpjack, Feb 5, 2010 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    OK what you need to do is use a different image url.

    try this code. hope it will help you.

    
    
    <?php
    
        function getPage($url) {
    
            $ch = curl_init();
    
            curl_setopt ($ch, CURLOPT_URL, $url);
            curl_setopt ($ch, CURLOPT_HEADER, 0);
            curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
            
            
            $result = curl_exec ($ch);
    
            curl_close ($ch);
    
            return $result;
        }
      
      
        header ("Content-type: image/gif");
        echo getPage('http://www.sat24.com/image.ashx?country=it&type=last&time=201002050700&sat=');
      
    ?>
    
    Code (markup):
     
    stephan2307, Feb 5, 2010 IP
  3. jumpjack

    jumpjack Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    this does not work, even by hand; I need to be able to choose date/hour and to download for VISIBILE rather than INFRARED channel.
     
    jumpjack, Feb 5, 2010 IP
  4. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #4
    This DOES work. For visible channel use this link

    
    http://www.sat24.com/image.ashx?country=it&type=slide&time=201002050800&index=1&sat=vis
    
    Code (markup):
    In the url you can see time=201002050800
    this means it loads the image from 05.02.2010 8am
    change the time and date

    if you want to save the image then you need to use fopen, fwrite and fclose.

    But I can assure you that this DOES work I have TESTED it myself.
     
    stephan2307, Feb 5, 2010 IP
  5. jumpjack

    jumpjack Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it works only for today :(
    Working:
    http://www.sat24.com/image.ashx?country=it&type=slide&time=201002050900&index=1&sat=vis

    Not working
    http://www.sat24.com/image.ashx?country=it&type=slide&time=201002020900&index=1&sat=vis

    But where do you get possible values for parameters?:confused:
     
    jumpjack, Feb 5, 2010 IP
  6. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #6
    Sorry I don't have time to mess around with this any longer. But good luck.
     
    stephan2307, Feb 5, 2010 IP
  7. jumpjack

    jumpjack Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    found other interesting URLs to decode:
    http://www2.sat24.com/homepage.aspx?html=zoom&xas=360&yas=340 (note the www2)

    http://www2.sat24.com/mysat/1480-1460-METE_RGB-12-12-1_europa1500m-ano_1002051030.gif

    http://www.sat24.com/maptravelertijd.js

    http://www2.sat24.com/HomepageAnim.aspx?country=it&sat=vis&type=slide (click & zoom & pan)

    http://www2.sat24.com/image.ashx?country=eu&type=slide&index=1&sat
     
    Last edited: Feb 5, 2010
    jumpjack, Feb 5, 2010 IP
  8. jumpjack

    jumpjack Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    anyone else?!?
     
    jumpjack, Feb 7, 2010 IP