Webpage thumbnail script

Discussion in 'Programming' started by MCJim, Jun 29, 2008.

  1. #1
    I need a script to generate thumbnail images of any webpage to use on a website. Anyone?
     
    MCJim, Jun 29, 2008 IP
  2. MCJim

    MCJim Peon

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Something like how Alexa.com generates thumbnail images...
     
    MCJim, Jun 29, 2008 IP
  3. pluto459

    pluto459 Active Member

    Messages:
    1,221
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    80
    #3
    try thumbshot.org
    there is another one but i can remember it
     
    pluto459, Jun 29, 2008 IP
  4. MCJim

    MCJim Peon

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I need an actual script though to use for a website. I can't use another website for this.
     
    MCJim, Jun 29, 2008 IP
  5. kijakarn

    kijakarn Peon

    Messages:
    404
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Me too , I try searching for that but ppl says it needs linux , screen capture and this and that.
     
    kijakarn, Jun 29, 2008 IP
  6. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
  7. NightZ

    NightZ Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i have this youtube thumb script but i cant get the thunbs to show up.

    i need.......
    http://img.youtube.com/vi/ySk1UCUV4bo/default.jpg
    but im getting.............
    http://img.youtube.com/vi/ySk1UCUV4bo&feature=youtube_gdata/default.jpg

    How do i correct the take out the &feature=youtube_gdata line?

    the code for php is.
    <?php

    function yt($ytsearch) {

    global $ytcurrenttag;
    global $ytvids;
    global $ytid;
    $ytvids = array();
    $ytid=0;

    function ytinsidethetag($ytparser, $ytdata){
    global $ytcurrenttag;
    global $ytvids;
    global $ytid;
    if(!strcmp(strtolower($ytcurrenttag)… {
    $ytvids[$ytid]['type'] = "yt";
    $ytvids[$ytid]['title']=$ytdata;
    $ytvids[$ytid]['title'][0] = ucwords($ytvids[$ytid]['title'][0]);
    }

    }

    function ytopentag($ytparser, $ytdata, $ytattr=''){
    global $ytcurrenttag;
    $ytcurrenttag = $ytdata;
    global $ytvids;
    global $ytid;
    if(!strcmp(strtolower($ytcurrenttag)… {
    $ytvids[$ytid]['link']=str_replace(…
    $ytvids[$ytid]['thumb']=str_replace…
    $ytvids[$ytid]['thumb'].="/default.…
    }
    }

    function ytclosetag($ytparser, $ytdata){
    global $ytid;
    if(!strcmp(strtolower($ytdata),"entr…
    $ytid++;
    }

    $ytxml_parser = xml_parser_create();

    xml_set_element_handler($ytxml_parser… "ytopentag", "ytclosetag");

    xml_set_character_data_handler($ytxml… "ytinsidethetag");



    include("fetch.php");
    $ytdata = fetchrssyt("http://gdata.youtube.com/fee…
    if(!(xml_parse($ytxml_parser, $ytdata)))
    die("Error on line " . xml_get_current_line_number($ytxml_parse…

    xml_parser_free($ytxml_parser);

    return $ytvids;
    }

    ?>


    thanks
     
    NightZ, Sep 16, 2009 IP
  8. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    #8
    Above should fix it, add it to your php file.
     
    Last edited: Sep 19, 2009
    st1905, Sep 19, 2009 IP
  9. grandnagel

    grandnagel Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    thumbnails will obviously be faster if there are more than a few pages... but I played with just shrinking a page inside an iframe and it worked for a bit and then I broke it somehow. heres what I had by that point...

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <style type="text/css">
    body {width:100%;}
    .frameclass {
    zoom:.3!important;
    /* the zoom worked earlier but not anymore ??? */
    }
    .frameclass2 {width:90%; height:90%; zoom:2!important;}
    </style>
    <title></title>
    </head>
    <body>
    <div>
    <div style="float:left;">
    <button style="vertical-align:top;" onclick="return changeFrameClass('frameid')">click</button>
    </div>
    <div style="float:left;clear:left;">
    <button style="vertical-align:top;" onclick="return changeFrameClass('frameid2')">click</button>
    </div>
    </div>
    <div>
    <iframe src="http://news.bbc.co.uk/2/hi/5098706.stm" name="framename" class="frameclass" id="frameid2" scrolling="no" frameborder="yes">
    </iframe>
    <iframe src="http://news.bbc.co.uk/2/hi/5098706.stm" name="framename" class="frameclass" id="frameid" scrolling="no" frameborder="yes">
    </iframe>
    </div>


    <script type="text/javascript">
    function changeFrameClass(id){
    var t = document.getElementById(id);
    t.className = t.className=='frameclass2' ? 'frameclass' : 'frameclass2';
    }
    </script>
    </body>
    </html>
     
    grandnagel, Dec 28, 2010 IP