OtherSites
From WUUki
Contents |
[edit] OtherSites
[edit] Update
N.B. As of version 1.7.560 the entry of OtherSite and Child Addon information has been improved by the use of Templates which can be selected when OtherSite or Child is selected as the Site Id.
Please post OtherSite/Child entries which you have that aren't currently supported in the Templates file and they will be added
OtherSites allows WUU to manage addons on sites which are not specifically handled.
Addon Directory: is the directory name the addon is in.
Friendly Name: is one of several fields that can be used in the regexp (regular expressions) used to get addon information. REQUIRED
Source Site: must be OtherSites.
Site ID: is the base URL that is used in conjunction with the Addon Information Page to get the Addon details, version and extension. REQUIRED
Download Name Expression: is where you build up the name of the download file. N.B. The case of the words IS important otherwise the file won't be found. REQUIRED
Version info is a Date: allows for a Date to be used when no version number exists for the addon. See examples.
Date Format: allows for different Date Formats to be used. Allowable values are Year, Month, Day, Hour & Minute in any order separated by a space. REQUIRED if Version info is a Date is set.
Addon Extension regexp: is how WUU extracts the download file's extension. REQUIRED
Addon Information Page: is used if the Site ID: doesn't point to the addon page itself. Can be left blank. See examples.
Addon Version regexp: is how WUU extracts the download file's version, usually a number but can be a date. REQUIRED
Use Last Version string: allows the version info to be taken from the last addon entry on the page instead of the first. See examples.
Use Extension as Name allows the Extension RegExp to define the download filename
[edit] Regexp fields
The fields that can be used in the regexps are as follows:
%(site)s - the Site ID
%(name)s - the Addon Directory
%(fname)s - the Friendly Name
%(ver)s - the Version
%(ext)s - the Extension
%(dlname)s - the download filename
%(lcname)s - the Addon Directory in lowercase
name and fname can be used in the Addon Extension regexp
name, fname and ext can be used in the Addon Version regexp
They can all be used in the Download Name regexp
[edit] Example
Using the Super Macro example I will attempt to explain, in the following steps, how it all works, especially the regexp strings.
- Using your web browser goto the addon page, in this example it is: http://sagez.net/amuseum/wow/addons.html
- To determine what goes in Site ID: and what goes in Addon Information Page: find the clickable link for the Super Macro download and look at the URL. You will see that it is: http://sagez.net/amuseum/wow/supermacro.zip,
- this means that addons.html must go in Addon Information Page:
- and http://sagez.net/amuseum/wow/ must go in Site ID: - Use the browser option to view the page source, as this is what we need to look at
- Find the addon name in the page's html code, in this example it is:
Zip for <a href="supermacro.zip" >Super Macro addon</a> to use with World of Warcraft
-- Updated Feb. 12, '07
- Looking at this html we can see several different ways the addon has been named.
- We put Super Macro in Friendly Name: as we will need to use this in the regexps. - There isn't a version number but there is a Date, so we check Version info is a Date:
- From step 2 we can see that the Download Name Expression: %(site)s%(lcname)s.%(ext)s consists of:
- %(site)s - the Site ID:
- %(lcname)s - the Addon Directory in lowercase
- . - a fullstop/period - DON'T forget this
- %(ext)s - the Addon Extension
- The Addon Extension regexp: <a\shref="%(name)s\.(.+?)"> is made up of the following components:
- <a - less than sign followed by a lowercase A
- \s - a space
- href= - a string of characters
- " - a double quote
- %(name)s - the Addon Directory
- \. - a fullstop/period MUST be preceeded by \
- (.+?) - brackets denote info we want to extract, .+? just these characters - the Extension (zip)
- " - a double quote
- > - a greater than sign
- The Addon Version regexp: %(fname)s.+\n.+Updated\s(.+)\.\s(\d+),\s'(\d+) is made up of the following components:
- %(fname)s - the Friendly Name:
- .+ - any characters
- \n - a newline
- .+ - any characters
- Updated - the word Updated
- \s - a space
- (.+) - brackets denote info we want to extract, .+ any characters - the Month (Feb)
- \. - a fullstop/period
- \s - a space
- (\d+) - brackets denote info we want to extract, \d+ one or more numbers - the Day (12)
- , - a comma
- \s - a space
- ' - a single quote
- (\d+) - brackets denote info we want to extract, \d+ one or more numbers - the Year (07)
What these regexp's are doing is extracting just the information we want from the whole page, this is why we need to specify the precise html data we are interested in and use the Friendly Name: as an anchor
Check out the other examples to see what can be done.
The Loot Link example has Addon information on one site but uses a different one to download from.
The Necrosis example deals with an % character in the search regexp, (Hint: use %%)
The MobMap example includes a Child Addon entry for the MobMapDatabase
OtherSites Text Versions has the text versions of the Images, useful for Copy and Paste - now deprecated in favour of the new Template system in version 1.7.560
For more information on Regular Expressions in Python try Regular Expression Syntax and Regular Expression HOWTO
