Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
translator_overview [2007/11/07 10:04] – Where the hack is Zotero's metadata format documented? I'll do it. jvossdev:translator_overview [2008/12/11 12:18] ahoward
Line 4: Line 4:
  
 ===== Step 1: Should I Run? ===== ===== Step 1: Should I Run? =====
-The first thing that a site translator needs to know is whether it should run on a web page.  Every time a Zotero visits any web page at all, Zotero checks the page URL against its translator database to see whether it finds any matching translators.  This operation is extremely quick and is meant only to find a match at the very highest level.  We don't yet care whether the web page has any metadata or search results: we just want to know whether we're in the ballpark.  This scanning operation uses a regular expression.  For example, to determine whether we should run the Amazon.com translator, we search for: <code>^http://(?:www\.)amazon</code>+The first thing that a site translator needs to know is whether it should run on a web page.  Every time a Zotero user visits any web page at all, Zotero checks the page URL against its translator database to see whether it finds any matching translators.  This operation is extremely quick and is meant only to find a match at the very highest level.  We don't yet care whether the web page has any metadata or search results: we just want to know whether we're in the ballpark.  This scanning operation uses a regular expression.  For example, to determine whether we should run the Amazon.com translator, we search for: <code>^http://(?:www\.)amazon</code>
  
 Any page with a URL beginning with <code>http://amazon</code> or <code>http://www.amazon</code> will bind to this translator.  By leaving off ''.com'' we allow this particular translator to to run on any of Amazon's international sites: amazon.ca, amazon.co.jp, amazon.co.uk, amazon.de, and amazon.fr.  Any page with a URL beginning with <code>http://amazon</code> or <code>http://www.amazon</code> will bind to this translator.  By leaving off ''.com'' we allow this particular translator to to run on any of Amazon's international sites: amazon.ca, amazon.co.jp, amazon.co.uk, amazon.de, and amazon.fr. 
dev/translator_overview.txt · Last modified: 2017/11/12 19:53 by 127.0.0.1