Title: Building Your Web Site
1Building Your Web Site
2Your Project
- Make a web site that shows plots that YOU
generated! - Plots should regenerate every hour!
3Step 1 Decide what plots you want to show
- Pick out a couple of charts that can be made with
the programs we have written this semester. - Dont go nutsmaybe 4 or 5 plots at most!
4Step 2 Make special versions of your programs
with NO interaction!
- Your programs shouldnt require anyone to choose
a variable, domain, contour interval or anything
like that. - Each program should produce ONE chart!
5Step 3 Modify these programs so that they
produce an XWD file
- XWD XWindow Dump
- a file format for images, similar to GIF
- Well learn how to do this later.
6Step 4 Create a script that runs these
programs.
- scripts little programs that perform unix
commands. - Well learn more about this later.
7Step 5 Set up a crontab that runs your
script each hour
- crontabs are scripts that execute on a schedule.
- Well learn more about this later.
8Step 6 Make an HTML page to display your output
- You already know how to do this!
9The Steps
- Decide what youll show
- Versions w/o interaction
- Produce XWD files
- Set up scripts
- Set up crontabs
- Write HTML code
10Step 3 Produce XWD files of your maps
- /export/home/schragej/X/xwdjms
- a special version of a standard unix program
xwd - captures a graphics window and saves it as a .xwd
file - no beeping!
- xwdjms name myplot
11Step 3 Produce XWD files of your maps
- /export/home/schragej/X/xwdjms
- a special version of a standard unix program
xwd - captures a graphics window and saves it as a .xwd
file - no beeping!
- xwdjms name myplot
The name of the graphics window that you
opened! Dont use any spaces!
12Step 3 Produce XWD files of your maps
- xwdjms uses printf to dump everything it does
to the screen. - You need to capture this to a file!
- xwdjms name myplot gt image.xwd
13Step 3 Produce XWD files of your maps
- xwdjms is a UNIX command, not a C command!
- system( )
14Step 3 Produce XWD files of your maps
- xwdjms is a UNIX command, not a C command!
- system( )
- Example
- system(rm .dat)
15Step 3 Produce XWD files of your maps
- system(/export/home/schragej/X/xwdjms name
myplot gt image.xwd)
16Step 3 Produce XWD files of your maps
- system(/export/home/schragej/X/xwdjms name
myplot gt image.xwd) - Also, turn off the ghold!!!!!!!!
17Step 3 Produce XWD files of your maps
- system(/export/home/schragej/X/xwdjms name
myplot gt image.xwd) - Also, turn off the ghold!!!!!!!!
- Still more problems
18Step 3 Produce XWD files of your maps
- Draw the map
- Draw the data
- system(xwdjms)
- Even though youve given the orders to draw all
the lines and all the data, the graphics might
not keep up
19Step 3 Produce XWD files of your maps
- Draw the map
- Draw the data
- system(xwdjms)
- when you call xwdjms, its possible/likely that
the picture isnt done yet! - Youll capture a partial image!
20Step 3 Produce XWD files of your maps
- Draw the map
- Draw the data
- XFlush(display)
- system(xwdjms)
- You need to XFlush the display.
21Step 3 Produce XWD files of your maps
- Draw the map
- Draw the data
- XFlush(display)
- system(xwdjms)
- You need to XFlush the display.
22Step 3 Produce XWD files of your maps
- Draw the map
- Draw the data
- XFlush(display)
- system(xwdjms)
- Display display
- display gget_xdisplay()
23Step 3 Produce XWD files of your maps
- Display display
- display gget_xdisplay()
- Draw the map
- Draw the data
- XFlush(display)
- system(xwdjms)
24The Steps
- Decide what youll show
- Versions w/o interaction
- Produce XWD files
- Set up scripts
- Set up crontabs
- Write HTML code
25Step 4 Create a script that runs these
programs.
- scripts little programs that perform unix
commands. - An example of a script
26Step 4 Create a script that runs these
programs.
! /bin/csh f rm .gif mv sample.data my.data
27Step 4 Create a script that runs these
programs.
- All scripts start with pound bang space slash
bin slash sea ess aich space minus eff
! /bin/csh f rm .gif mv sample.data my.data
28Step 4 Create a script that runs these
programs.
- Everything after that just runs as if you typed
it at the keyboard in Unix.
! /bin/csh f rm .gif mv sample.data my.data
29Step 4 Create a script that runs these
programs.
- Everything after that just runs as if you typed
it at the keyboard in Unix.
! /bin/csh f setenv DISPLAY wx-sun10. rm
.xwd MakeTempContours /opt/sfw/bin/convert
image.xwd temperature.gif mv temperature.gif
public_html
30Step 4 Create a script that runs these
programs.
- Change the execution privileges on your script
- chmod ax MyScript
- Test it.
31The Steps
- Decide what youll show
- Versions w/o interaction
- Produce XWD files
- Set up scripts
- Set up crontabs
- Write HTML code
32Step 5 Set up a crontab that runs your
script each hour
- crontabs are scripts that execute on a schedule.
- To edit a crontab, you need to have set the
EDITOR variable to your favorite editor - setenv EDITOR vi
- setenv EDITOR pico
33Step 5 Set up a crontab that runs your
script each hour
- start editing
- crontab e
- Every line of the crontab schedules one task to
be run repeatedly. - There are 6 entries on every line
34Step 5 Set up a crontab that runs your
script each hour
- The first entry is the MINUTE of each hour during
which to run your job.
Adams 1
Affelt
Augustyn 2
Campbell 3
Craft 4
Dea 5
Fontaine 6
Franks 7
Hollibaugh 8
Hyda 9
Karr 10
Malone 11
Novella 12
Robinson 13
Selin 14
Smoliak 15
Taylor 16
Wilson 17
15 /export/home/schragej/MyScript
35Step 5 Set up a crontab that runs your
script each hour
- Entries 2, 3, 4, and 5 are the hour, day, day of
week and day of month on which to run the job. - A star means every.
15 /export/home/schragej/MyScript
36Step 5 Set up a crontab that runs your
script each hour
- The sixth entry is the name of your script, with
the full path name! - If your script prints ANYTHING to the screen,
youll need to include - gt /dev/null
- or the output will be emailed to you!
15 /export/home/schragej/MyScript
37The Steps
- Decide what youll show
- Versions w/o interaction
- Produce XWD files
- Set up scripts
- Set up crontabs
- Write HTML code
38Your (Last!) Assignment
- Impress me with a web site with weather charts
that refresh hourly!