Some insight on whats going wrong [Not a coding problem, but concept problem]
Hello All,
Well being from non-CSE background does hamper me many times and here it is again. I am simply trying to write a script, which will take screenshots of the websites gives as input parameter to it. Well the algorithm is simple: 1. Open site on your browser 2. Take a screenshot 3. Save the screenshot Now I tried this on my local Ubuntu (running using VMWare) and here is what i tried: Code:
sleep 10; xwd -root | convert - screenshot.jpg Now I wanted this to be reproduced on my VPS (Debian, text only with no monitor/screen). So i went and tried, xwd which was not installed on by default. So I installed the xbase-clients package. But now when I try to run xwd, it says : Code:
xwd: unable to open display '' Code:
startx Can someone kindly guide me through this? Is it really not possible to do this on my VPS, which I was doing with ease on my Ubuntu box. Regards, Imoracle |
Quote:
|
yeah here is where the problem comes......I prepared script on my local ubuntu box and then tried to move to my VPS. But now I suddenly realize that i dont have a monitor to take a screenshot from.
I am not sure how can I achieve this or how do others achieve this. Any pointers will be highly appreciated. Imoracle |
Well I'd still like to help but I don't realy understand what your doing here. You are trying to take a screenshot of what a web page looks like on a headless computer. why?
|
Actually I am making a service where people will submit there blog url's and I will show them to the world. But instead of simply showing the blog name, post title and post snippet I also want to have a snapshot of the post page.
Now problem is: User comes and submit his blog/site etc etc. How do I take snapshot of his submitted article. Hence I thought of the above steps to achieve this, which seemed to be working fine on my local ubuntu but not on my VPS (Debian). I have only shell access to my VPS. So this is the problem in short. Another problem is that I simply don't want to have the thumbnails by using some third party tool etc, in the process I also want to learn the methodology used by some sites to generate them. Regards, Imoracle |
A better alternative would be to fetch the contents with a 'wget' script. Now all you need to find is a tool to render the html to an image file like png.
|
All times are GMT -5. The time now is 10:25 AM. |