File: examples.html

package info (click to toggle)
twill 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,472 kB
  • ctags: 1,916
  • sloc: python: 12,686; java: 98; makefile: 18; sh: 2
file content (45 lines) | stat: -rw-r--r-- 1,629 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.7: http://docutils.sourceforge.net/" />
<title>twill Examples</title>
<link rel="stylesheet" href="default.css" type="text/css" />
</head>
<body>
<div class="document" id="twill-examples">
<h1 class="title">twill Examples</h1>
<div class="section" id="example-logging-into-slashdot">
<h1><a name="example-logging-into-slashdot">Example: logging into slashdot.</a></h1>
<p>This script logs you into slashdot (assuming you have an account!).</p>
<pre class="literal-block">
setlocal username &lt;your username&gt;
setlocal password &lt;your password&gt;

go http://www.slashdot.org/
formvalue 1 unickname $username
formvalue 1 upasswd $password
submit

code 200     # make sure form submission is correct!
</pre>
</div>
<div class="section" id="example-searching-google-and-going-to-the-first-hit">
<h1><a name="example-searching-google-and-going-to-the-first-hit">Example: searching Google and going to the first hit</a></h1>
<p><em>Please be aware that automated searching of Google violates their
Terms of Service.  This is for example purposes only!</em></p>
<pre class="literal-block">
setlocal query &quot;twill Python&quot;

go http://www.google.com/

fv 1 q $query
submit btnI     # use the &quot;I'm feeling lucky&quot; button

show
</pre>
</div>
</div>
</body>
</html>