zeal5050 Posted June 18, 2009 Share Posted June 18, 2009 Hi all, I'm interested in creating a social bookmarking site similar to delicious, or digg. However I'm struggling with the conceptualization. I would like for the site to generate a screen shot of the website a user has bookmarked without them actually having to upload an image! I'm wondering if this is at all possible without me storing thousand of images on my database. I searched online and I came across a few alternatives. I was primarily interested in this site, Snapcasa. The site allows you to enter a url and the gets the screen shot based on that url. Any way to incorporate this site into my project? Any help would be greatly appreciated, or if you can point me to some examples of this that would be great also! Regards, Zeal Quote Link to comment https://forums.phpfreaks.com/topic/162687-get-images-from-url/ Share on other sites More sharing options...
MadTechie Posted June 18, 2009 Share Posted June 18, 2009 Your need to change the Apache service to 'Allow service to interact with desktop', and then control a browser (IE, FF, etc) via a COM make it full screen, tell it to go to the URL and then use imagegrabscreen, to grab the screenshot <?php header('Content-Type: image/png'); $im = imagegrabscreen(); imagepng($im); imagedestroy($im); ?> Quote Link to comment https://forums.phpfreaks.com/topic/162687-get-images-from-url/#findComment-858567 Share on other sites More sharing options...
zeal5050 Posted June 18, 2009 Author Share Posted June 18, 2009 Thanks for the quick reply! Can you elaborate on this please? how to I control the browser? Do i need to create a function to tell the browser to go to URL? Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/162687-get-images-from-url/#findComment-858816 Share on other sites More sharing options...
MadTechie Posted June 18, 2009 Share Posted June 18, 2009 Heres an example <?php $browser = new COM("InternetExplorer.Application"); $handle = $browser->HWND; $browser->Visible = true; $browser->Navigate("http://www.libgd.org"); /* Still working? */ while ($browser->Busy) { com_message_pump(4000); } $im = imagegrabwindow($handle, 0); $browser->Quit(); imagepng($im, "iesnap.png"); imagedestroy($im); ?> Quote Link to comment https://forums.phpfreaks.com/topic/162687-get-images-from-url/#findComment-858931 Share on other sites More sharing options...
zeal5050 Posted June 19, 2009 Author Share Posted June 19, 2009 hmm I don't think this solution will work for me. I don't think my hosting will allow me to run iexplore. I have come across another solution that uses the SnapCasa API, but I'm having trouble understanding how to implement it in my site. Maybe someone here can shed some light on this. <?php ini_set("display_errors", "on"); error_reporting(E_ALL); define("CODE", "1234"); // depend on what is "User Code" when you register with snapcasa.com define("LOCATION", "http://www.myserver.com/php/images"); // Location to store the thumbnail define("SIZE", "S"); // size of the thumbnail: T, S, M, L function generate_site($url) { $name = str_replace(".", "", $url); $thumb = LOCATION.$name.'.jpg'; $request_for ='http://snapcasa.com/Get.aspx?code='.CODE.'&size='.SIZE.'&url=http://'.$url; copy($request_for, $thumb); } echo "<h3>This is a test of the SnapCasa API<h3>"; generate_site("www.google.com"); ?> There must be a simpler way to get user generated thumbnail images! ??? Quote Link to comment https://forums.phpfreaks.com/topic/162687-get-images-from-url/#findComment-859327 Share on other sites More sharing options...
MadTechie Posted June 19, 2009 Share Posted June 19, 2009 Your need to updated the control level from the system as user account as well so it only really working if you have full access, if you don't have a full access your need to use another services API Quote Link to comment https://forums.phpfreaks.com/topic/162687-get-images-from-url/#findComment-859487 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.