Can't install Solvent

Dear Zotero,

I have tried to follow the instructions to install Solvent. They does not seem to work in FF 9.0.1. I just get "... incompatible with Firefox 9.0.1".

The instructions I tried to follow are here:
http://niche-canada.org/member-projects/zotero-guide/chapter3.html
  • edited January 8, 2012
    Unfortunately, This (good) tutorial is outdated on many points.
    It has been wikified and updated (a year and half ago...) by Tom Roche here.

    In some (simple) cases, you should consider using the "translator framework".

    I use Firebug to get XPath.
  • Thanks Gracile.
  • I'd actually put this differently. In 99% of the cases addressed by Adam Crymbel's tutorial you will be _much_ better of using the translator framework.
  • This made it much clearer. I will try the translator framework.

    BTW Scaffold has a checkbox for including this framework. This should be a button instead since clearing the checkbox does not remove the framework.
  • So below is my first attempt with the translator framework. It seems very nice! Some questions etc:

    - The field Scaffold/Target is not used by FW. Is it used at all?

    - What should be put in Scaffold/Min. Version?

    - How can I normalize the date (ISO format preferred)?

    - Why does not my "tags" work? Could Scaffold perhaps tell that the object type is wrong?

    - What is "libraryCatalog" and where did I specify that? ;-)

    - Any suggestion for what to do with FW.MultiScraper and how to block list pages for FW.Scraper?

    Tested on this page:
    http://www.psychologytoday.com/blog/mad-in-america/201112/cognitive-therapy-found-effective-in-unmedicated-psychotic-patients-and-o

    Here is the FW code:

    function detectWeb(doc, url) { return FW.detectWeb(doc, url); }
    function doWeb(doc, url) { return FW.doWeb(doc, url); }

    FW.Scraper({
    itemType : 'blogPost',
    // detect : FW.Url().match(/(\/node\/\d+|articles\/[a-zA-Z0-9]+\.shtml)/),
    detect : FW.Url().match("^http://(?:www.)?psychologytoday.com/blog/"),
    title : FW.Xpath('/html/body/div/div[4]/div/div[2]/div/div/h1').text().trim(),
    creators : FW.Xpath('/html/body/div/div[4]/div/div/div/div[2]/div[2]')
    .text().replace(/\s/," ")
    .trim()
    .replace(/^by /, "")
    .cleanAuthor("author"),
    date : FW.Xpath('/html/body/div/div[4]/div/div[2]/div/div[3]/span')
    .text()
    .match(/[a-z]+ [0-9]+, 20[0-9][0-9]/i),
    // tags : FW.Xpath('//div[@class="terms terms-inline"]/ul/li/a[@rel="tag"]').text(),
    tags : FW.Xpath('/html/body/div/div[4]/div/div[2]/div/div[4]/div[3]/div[2]/div[4]')
    .text()
    .replace(/Tags:/, "")
    .trim()
    .split(/,\s*/),
    blogTitle : FW.Xpath('/html/body/div/div[4]/div/div/div/div[2]/h1/a').text().trim(),
    abstractNote : FW.Xpath('/html/body/div/div[4]/div/div[2]/div/div[2]').text().trim(),
    downloadAssociatedFiles : false
    });
  • Let's keep translator development questions over at zotero dev:
    http://groups.google.com/group/zotero-dev

    If you post there I suggest you post the entire code to gist.github.com - it's much easier to read and download that way.

    What I can say so far is that you don't want to use full xpaths - they are much too fragile. Instead you want to use abbreviated xpaths like
    //div[@class="title"] and the like.
  • Please do direct further questions to zotero-dev, but I'll answer the Scaffold-related ones here for good measure. If you do not insert the framework code manually into the translator by pasting it from Erik's repository, the framework code will be included if and only if the checkbox is checked. There is a little bit of boilerplate-- the detectWeb and doWeb functions -- that will be inserted and not removed when checking and unckecking the checkbox, but the real framework code is a massive minified line that is blissfully hidden from you while you are working within Scaffold.

    Scaffold will handle the date automatically, and don't worry about the minimum version; if it matters, I'll set it before putting it in the repository (it almost never matters).
  • General information on things like target expressions can be found in the main translator development documentation: http://www.zotero.org/support/dev/translators
  • Thanks adamsmith, I will go to zotero-dev. And thanks for the hint about abbreviating the paths.

    Thanks ajlyon, I see. Perhaps some message about what is included/removed when checking/unchecking that checkbox would make it more clear?

    Info about testing in standalone version should I ask that here, or?
  • Don't use standalone for testing or development. Develop in Firefox-- testing for connectors is done automatically. Do create tests for the translator, so we can check for compatibility automatically.
Sign In or Register to comment.