thumbnail generator using php code so to take scrrenshot of webpages - php

Actually I am running a wesite www.webmaggu.com which is mainly a directory of variou interesting links and websites which are submitted by users. I want to generate thumbnails beside the links. So tried webnapr, picoshot and many others but they don't give free thumbnails for longer days. so I want to generate my own thumbnail generator. I have seem various codes using IE capt on websites but I don't know why they are not working on my website www.webmaggu.com
Actually my hosting provider is linux based but they say they have GDI running on different servers which supports both linux and windows users...
so if any body can help with codes or some links .....

Under windows it's pretty easy. You need to enable gd in your php.ini file. You do that by removing the ; on the follow line:
extension=php_gd2.dll
Then use the following code:
<?php
$ie = new COM("InternetExplorer.Application") or die("Unable to instanciate Internet Explorer");
$ie->Navigate2("http://www.digeshops.com");
$ie->Visible = true;
while ($ie->ReadyState!=4) usleep(200);
$handle = $ie->HWND;
$img = imagegrabwindow($handle);
$ie->Quit();
imagepng($img,"screenGrap.png");
?>

If you want a 100% standalone solution for taking screenshots of websites, there is a project called khtml2png
It requires no external webservice and renders a webpage using the Konquerer engine under Linux. it should be pretty easy to install, depending on your Linux server distro.

Hi shashank
See something interesting here
10 Free Website Thumbnail Generation Services
http://www.neurosoftware.ro/wp/elvis/php/10-free-website-thumbnail-generation-services/
i will say , you to check http://www.thumbalizr.com/ coz there is api. using php you can generate and store info in db as if needed.
Some API based useful resource
http://webshotspro.com/
http://www.websnapr.com/
http://webthumb.bluga.net/home
http://quickthumbnail.com/

I think you should use a freeware hosted on your Linux.
For example (googled it) : http://code.google.com/p/webthumb/
It uses Mozilla for generating thumbnails.
Good Luck !

You mentioned above that you can't install djano on your shared hosting account, which probably means you can't install any of the solutions mentioned here, let alone install something you've written yourself.
The way I see it you have 2 solutions:
1) With a bit of hacking you could create the thumbnails automatically on your home PC, and FTP them to your hosting account.
2) Read the Terms of Use for the free services you're using. There's a good chance they're blocking you. I'd suggest caching the thumbnails locally, and serving them from your server instead of hot linking them.

Related

How to change a file inside apk and change cert.sf and manifest.sf without java but with php

I am new here. I haven't found any solution to my problem.
WHY i need that? I am building a Joomla based system for fast custom Android app creation working on php hostings having no java installed available for people to develop and install apps easily on their devices. Thus i am interested only PHP or universal-like solutions implementable in PHP too. Only CHANGING FILES UNPACKED AND NOT DECOMPILED IS AN OPTION. No apktool no whatever else like that. I am working with DEBUG packages with self generated keys. or something like that, because i am a beginning phone gap developer.
For example i would like my own icons for an app, or change the title of it in AndroidManifest.xml. And update sha1 digest hashes for cert.sf and manifest.sf for the changed files. I need human understandable procedure step by step.
PHP gives sha1 and base64 encoding and many more like that.
I was trying to get the same codes like cert.sf and manifest.sf (no file was changed before) but i wasn't able to do so. I tried silly ways to sha1 files and base64 them and no outcome was as in the files mentioned.
Please there is no answer like that i need.
Let me say the anwswer to the question will help people or at least will help to build application development systems.
P.S.
For Adobe Air apps i will be trying to do the same what for .apk apps. I hope it won't create the same issues. But not about it is the main question.
UPDATE:
I feel from a couple topics of this kind that any practical help on this matter is unavailable and sometimes even perceived negatively. Thus what i am going to do is to use an additional server for making apps (simply command: cordova build) and send an app produced to a server which requested for it. This only because for some unknown reasons i cannot sign any files with php (debug packages). But why? It seems that the effect would be just the same as with installing running stuff with additional server using java, would it not?
Update:
I don't think there will be any answer. So i do .air and .apk apps using home computer hosting java what is not the best idea - two servers one not professional. There is http://build.phonegap.com/ and it can be interesting for building apps manually or via api. For free one app can be private and more open source. IOS and Windows are supported too there.
If you change a file, you must resign the APK with an existing certificate.
APK files are signed with the java jarsigner tool, so you can't do it only manually just by editing some files, you need the private key of the certificate.
Maybe you should try to add a Java application next to your Joomla server and use jarsigner for signing the generated APKs.

Website thumnails (screenshots)

I want to create website thumbnails (screenshots) using php. I have a dedicated server running centos 5.5 so I can install software on it.
I need a free solution to create thumbnails of websites on a production server without running X server. (If I was to run X server how much difference would it make to the performance).
I would also appreciate if you could provide me with any free web services which could help me get the website thumnails and download them to my server.
To take a virtual screenshot of a website, use khtml2png. It uses libkhtml, the rendering engine used by the konquerer brower, and imagemagick.
Try this, I used it when I was building a site that required thumbnails of other websites:
http://www.thumboo.com/
Note that you will need to sign up for the API.
Hope this helps and that I understood your question

A way to work on web projects with others without over writing files.. etc

I am a web freelancer and had been doing all coding by myself using netbeans (set up to use a remote server (ftp)).
Recently, I started working with 2 other guys. They help me with php and css. The problem is that sometimes we want to work at the same time. Obviously one can immediately see the problems were having. Files being over writting / lost.
What do you recommend we do? Is there something like netbeans that allows checking in and out of files. I like netbeans as my editor and would prefer to keep it.
To give you a little extra information on our workflow. Usually I set up a dev site (generally a subdomain, dev.site.com) and a live site (site.com). All work is done on the dev site which I then move to live site once all is finished. I never use localhost sites.
Also
Surely you need a version control system. Subversion and Mercurial (amongst others) integrate fairly well with Netbeans.
Simply use some versioning system to prevent data loss.
Git
CVS
SVN
Other option is to use some file locking system.
Take a look at some source code management tools. Netbeans supports at least SVN and CVS. They should be listed under the Team menu. It has a FAQ on which it supports
Sounds like a job for Github
Assembla provides a free SVN hosting for collaborative projects.

Linux-based MS Office thumbnail generation

I've been taken onboard to work on a PHP-based web application. One part of the application generates thumbnail images for MS Office documents on demand, and it uses MS Office + the VeryPDF docprint utility to do this. Because of this one requirement, the system is running on Windows Server 2003 + IIS.
I would prefer to have the system running on a Linux server, rather than MS, as I have far more experience in administering Linux systems than Windows and we have no other in-house technical staff.
Does anyone know a way to handle the document conversion using native Linux software? I would love something PHP native, but am willing to look outside that if necessary.
I have never done anything like this, so I'm just throwing an idea off the top of my head.
Have you thought about utilizing Open Office's capabilities to create thumbnail images? I know OO saves thumbnail images within a created document, so all you need to do is extract the image to display it. (This is demonstrated on the Ubuntu forums.) You could always do something sort of "hackish" where you use run a file through OpenOffice and extract the image to display a small thumbnail.
Again, I have no idea how well this will work, but it may be worth a shot.
To anyone else who comes across this, I have ended up going with the newer version of jodconverter. The sample code includes a basic web page that can be POSTed to using something like Pear's HTTP_Request2. A sample class (by yours truly) which uses this is mentioned in the comments in jodconverter's group on google code.

Alternative to Package Foundry? (PHP app installation)

I'm looking for an alternative to Package Foundry. It doesn't have to be - and I'm sure won't be - free or anything like that.
It also needs to be able to create a configuration file, which asks for their database details and such. Without that, it's just an automated FTP app, which is of limited use.
Are there any alternatives which might be able to automate the uploading and then just request some info from the user, and then perform a check to make sure they're valid?
NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.
Or distribute your application via a PEAR channel.
Take a look at InstallJammer. It's a free, open source installer that can do everything you need. Drop by the forums if you need some help getting started with your installer, and I'll be glad to show you how to do what you want here. It's actually been done by many before, so it's not all that hard. :)

Categories