Update: The content in this post maybe out of date or inaccurate.
If you are looking for more information on what this code does and why, please read:
*** Outdated Link Removed***
Basically, there are just two steps:
First is to install the following line of code into the header* of your page(s):
<script type="text/javascript" src="http://www.shrinktheweb.com/scripts/pagepix.js"></script>
Then in the body of the page (wherever you want to show a screenshot), you just put:
<script type="text/javascript">stw_pagepix('domain.tld', 'stwaccesskey', 'stwsize', 'language', 'stwargs');</script>
*The header of your page is between the <head> and </head> tags
Legend:
- domain.tld = the domain you want to show
- stwaccesskey = your STW Access Key (found in the HOME/LOBBY area)
- stwsize = the output size you want to show (tny, mcr, xsm, sm, lg, xlg)
- [OPTIONAL] language = English (EN) is the only language currently supported
- [OPTIONAL] stwargs = the pro features in a single string (i.e. &stwfull=1&stwxmax=400)
- If &stwxmax is specified, it will override the stwsize value
Basic Example:
<script type="text/javascript">
stw_pagepix('http://bing.com', 'abcdefghijklmno', 'xlg');
</script>The code above would show the extra-large (320x200) screenshot of http://bing.com and link to the preview page automatically. It can be all on one line or separated (as shown).
Advanced Example:
<script type="text/javascript">
stw_pagepix('http://bing.com', 'abcdefghijklmno', '', 'en', '&stwfull=1&stwxmax=400');
</script>The code above would show a custom size (400xFULL) screenshot of http://bing.com and link to the preview page automatically. If the account does not have the requested PRO features enabled, then an error image will be shown.
DEVELOPER NOTE: There is an stwhash parameter associated with the PVP method and you should NOT try to hardcode that value EVER. It will change each minute and your integration will be broken. This also means to be sure that pagepix.js is NEVER cached for performance reasons, which is common with CMS scripts. If the pagepix.js gets cached, users will most likely see "Account Problem" errors intermittently. The best way to avoid this is by using "Phantom Querystrings" (i.e. putting "?" and a timestamp on the js file).
Theming / Styling PVP Screenshot Images
If you want to fully integrate the thumbnails into your theme or style, then you can use the following CSS tag:
<style>
.stwpvp {
border:3px dashed #333;
}
</style>The CSS tag support was added due to user requests. As always, suggestions are welcome!



