Get web page from URL - url and base
Created: 2010-10-29 11:42:15
Last updated: 2010-10-29 11:42:16
Fetches a web page from http://www.mygrid.org.uk/tools with the base parameter as "http://www.mygrid.org.uk" and the url as "/tools". Note that when viewed, the HTML may not be rendered correctly. However, the HTML may be viewed by rendering the result as plain text.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (3)
Get web page from URL - url and base |
Get web page from URL - url and base |
Get web page from URL - url and base |
Descriptions (1)
Fetches a web page from http://www.mygrid.org.uk/tools with the base parameter as "http://www.mygrid.org.uk" and the url as "/tools". Note that when viewed, the HTML may not be rendered correctly. However, the HTML may be viewed by rendering the result as plain text. |
Dependencies (0)
Processors (3)
Name |
Type |
Description |
Get_web_page_from_URL |
localworker |
ScriptURL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
Reader inReader = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
int ch;
while ((ch = inReader.read()) > -1) {
buf.append((char)ch);
}
inReader.close();
contents = buf.toString();
//String NEWLINE = System.getProperty("line.separator");
//
//URL inputURL = null;
//if (base != void) {
// inputURL = new URL(new URL(base), url);
//} else {
// inputURL = new URL(url);
//}
//StringBuffer result = new StringBuffer();
//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
//String line = null;
//while ((line = reader.readLine()) != null) {
// result.append(line);
// result.append(NEWLINE);
//}
//
//contents = result.toString();
|
location_of_the_page_relative_to_the_base |
stringconstant |
Value/tools |
base_url |
stringconstant |
Valuehttp://www.mygrid.org.uk |
Datalinks (3)
Source |
Sink |
base_url:value |
Get_web_page_from_URL:base |
location_of_the_page_relative_to_the_base:value |
Get_web_page_from_URL:url |
Get_web_page_from_URL:contents |
out |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (0)
(People/Groups)
None
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment