i'm not going to post any code here because i don't know how to start doing it. Actually I need your help...
I am working with java (using netbeans, btw) and I have a database with multiple urls in a table (MySQL), and i want to get a screenshot of every url listed there, save it to my pc and then insert that screenshot (jpeg) in the url table. I was looking here on stackoverflow but i had no answer (not an automatic one, because i have to open a web browser and the aplication is supposed to be a standalone app) (The other option i found in this article -> (this) is unavailable.
In the same article i've read about the Flying Saucer Project, and maybe is the best option, but i have no idea of how to use it and i don't want to waste valious time reading every single thing that the project can do... so i'd appreciate a quick tutorial of how to use it.
Please, if u can post some code here would be great, but at least i'd like an answer of how to do this, or mambe some suggestions, that would be nice too. THANKS EVERYBODY.
You should take a look at CutyCapt:
CutyCapt is a small cross-platform command-line utility to capture WebKit's rendering of a web page into a variety of vector and bitmap formats, including SVG, PDF, PS, PNG, JPEG, TIFF, GIF, and BMP. See IECapt for a similar tool based on Internet Explorer.
Just execute the application from within your Java application. See Running Command Line in Java. The result would be something like::
p = Runtime.getRuntime().exec(String.format("./CutyCapt --url=%s --out=%s",
url, path));
Related
We are trying to develop a website for tracking the progress of pipeline and assets. I want to link progress data entered from forms developed in Java to GIS. We will be capturing all the lat and longs of pipeline stretch and lat and log of progress of work.
I need help in developing shapefile dynamically based on the progress and also to view that shape file in my webpage
The javascript API does have functionality for uploading shapefiles form your desktop into the browser, but you will need another tool to create those shapefiles based on the progress.
For uploading the shapefiles, see the example here: https://developers.arcgis.com/javascript/3/jssamples/portal_addshapefile.html
There may be more examples available at https://developers.arcgis.com/javascript/3/.
For creating the shapefiles dynamically, you could use ArcMap or ArcPro if you have those, or one of many python libraries to help write shapefiles. There may even be some Java libraries to help with this as well but I only work on the front end so I cannot help you there.
For something simple in context, the complexity of what kind of workflow to best suite your needs can range depending on these questions (and probably others I'm not thinking of):
Do you absolutely need to create a shapefile for this? Why can't you just push the form to a spatial database (e.g. PostGIS) and then return the XYs of the points or the string of XYs for line features, etc.?
Where is the source of the data & what is the format? Is it a PDF, text on an HTML page, a .csv file downloadable from a page, etc.? You may need to implement scraping (from a site) or download and update, or your data could be live streaming - these are all different workflows and you need to establish these boundaries before setting up your workflow.
If your end game are points, all you need is XYs in a table format to display in GIS software. If they are lines or polygons, it'd be a little different. Again - what output type are they and what are you trying to do with it (e.g. import into QGIS)?
Without these answers, it doesn't make sense for anyone to suggest something to you that could be totally impossible for you to execute. Please answer these and think through your workflow from beginning to end and/or visa versa.
Cheers,
Shawn
Today I want to know how to get image URL from webSite,
I already read some questions and answers but they're not quite perfect for me.
The problem is, when I enter the site, there are some images. It's pretty easy that I get image URl by UI, But, it's really hard that I get image URL by Java Servlet and jsp. Sometimes, some image url is in only networks!
For example, http://map.daum.net/ <-- this site.
Enter the site, and see 'RoadView'. When you see Codes in Chrome(F12), there are no image sources in jsp codes. Only you can see in Networks!
How can I get image URL(source)? Is it possible?
ps. I can get image source using mouse and right click, but I want to get image source using java automatically :), so please do not write user's perspective.
ps2. I'm not very well using English, so there are so many mistakes and something like rude. I apologize for that.
So, what you want to do is to scrape a dynamic content of the page to extract some dynamically loaded data (an image url) from it. You did not tell us what programming language or environment you want to use. However, similar questions have been asked before, for instance this one: How to scrape ajax loaded content with jsoup. There are two frameworks named in the answers to this question: PhantomJS and CasperJS. Both are JavaScript frameworks.
I need to download lecture videos from mediasite.com. Using this guide, I have been able to do so by saving the site locally and then getting the video url from the "manifest.js" file. However, since this method is long and convoluted, I would like to just be able to script the whole thing.
What tools do I need to complete these three steps:
Go to the lecture site
Extract video url from manifest.js file
Download the video
I've been told that using cURL or the .net lib in java might do the trick but I honestly don't know where to start. Would appreciate any help. Thanks
Firebug + Fiddler2 to find direct links.
I am using a java applet in my web project and some images are shown in this java applet.
I want to limit users to pull images from the web page. What are possible techniques for a client user to save images used in a java applet which is used in a browser session, except "print screen"?
Any ideas are welcome.
Thanks.
..What are possible techniques for a client user to save images used in a java applet
I don't know about typical end-users, but I'd do these things to circumvent several security strategies:
1. Hide them in the archives
Look at the source of the page
Discover the location of the Jars
Download each one by direct fetch
Rename them to .zip and expand them (quick & dirty), then..
Sell your images for causing me that much inconvenience to get them in the form I want.
That last part was sarcasm (mostly), but just wanted to make the point that if you put something in a Jar, people can get it out.
2. Hide them on the server
Use a packet sniffer to discover the image locations by URL.
Pull each image directly (etc.)
3. Encrypt the images
You might use techniques to encrypt the images, then obfuscate the code that decrypts them, but that would also fail against a determined hacker.
4. Screen grab
As mentioned already. 'Last resort' - crude, but effective.
..Any ideas are welcome.
Don't pursue such strategies. You won't achieve any form of security worth having, it will just irritate the user.
If the image is a bitmap inside of a jframe it'll be hard to capture it without resorting to a screen grab. Just like using it in flash the image file itself won't actually exist anywhere on the client.
I am working on an application which needs to preview privileged content in the browser. The preview should work in a way that its NOT possible to download the content. Only reading within the browser is allowed. I have looked at google docs preview but it needs the url of the docs to accessible online. I need to work with content in the intranet
The previewer should not mandate the installation of a pluggin as this would limit the access.
Any hints
Have a look at ImageMagick. If your're using, say, php, you could do something like
exec("convert -resize 500×800 {$file}.pdf {$file}.jpg");
and then display the resulting jpg-file on a webpage.
man convert should give you some further options.