Skip to content

Instantly share code, notes, and snippets.

@victorbstan
Created March 20, 2013 02:57
Show Gist options
  • Select an option

  • Save victorbstan/5201968 to your computer and use it in GitHub Desktop.

Select an option

Save victorbstan/5201968 to your computer and use it in GitHub Desktop.
Quick and dirty test web scraper in Smalltalk (Pharo2). Simply put it in a "workspace" and "do it". The response output is sent to a "Transcript" window.
| myHost myPath |
"setup"
myHost := 'rmod.lille.inria.fr'.
myPath := '/pbe2'.
ZnClient new
systemPolicy;
accept: ZnMimeType textHtml;
http;
host: myHost;
path: myPath;
contentReader: [ :entity | Transcript show: entity asString ];
ifFail: [ :exception | self inform: 'I am sorry: ', exception printString ];
get.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment