Skip to content

Instantly share code, notes, and snippets.

@alandipert
Created April 22, 2009 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandipert/99584 to your computer and use it in GitHub Desktop.
Save alandipert/99584 to your computer and use it in GitHub Desktop.
def page(query:String) = {
<html> <head>
<title>Book Search Results</title>
</head>
<body>
<h1>Book Search Results</h1>
<p>
You searched for
"<b>{ Text( query )}</b>"
</p>
<form action = "search" method = "post">
<table>
<tr>
<td>Search Terms:</td>
<td><input type = "text" name = "query">
</input></td>
<td><input type = "submit" value = "Search"></input></td>
</tr>
</table>
</form>
<table>
<tr>
<th>ISBN</th>
<th>Title</th>
</tr>
{
new AmazonResultPage()
.byTitle(query)
.get()
.books
.map((b:Book) => {
<tr><td>{b.isbn}</td><td>{b.title}</td></tr>
});
}
</table>
<p>
<i>{ java.util.Calendar.getInstance().getTime().toString() }</i>
</p>
</body>
</html>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment