Created
April 22, 2009 04:42
-
-
Save alandipert/99584 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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