Topic: Greasemonkey Scripts Template (test)

<?xml version="1.0" encoding="utf-16"?>
<Jobs>
  <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <DownloadBeta>Default</DownloadBeta>
    
    <CheckForUpdatesOnly><placeholder name="Check for updates only ?" value="false" options="true" /></CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <CanBeShared>true</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <Variables>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(?-s:([a-z]+ +\d{1,2},? +20\d{2}))</Regex>
            <Url><placeholder name="Script page from Userscripts.org OR Userstyles.org" /></Url>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>userstyles</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>href="([^"]+\.js)"</TextualContent>
            <Name>userstyles</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>userscripts</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>"(http://[^"]+\.js)"</TextualContent>
            <Name>userscripts</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>durl</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>{<placeholder name="Userscripts OR Userstyles ? (use characters in lowercase only)" value="userscripts" options="userscripts|userstyles" />}</Regex>
            <Url><placeholder name="Script page from Userscripts.org OR Userstyles.org" /></Url>
            <Name>durl</Name>
          </UrlVariable>
        </value>
      </item>
      
      <item>
        <key>
          <string>durl_userstyles</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{durl:regexreplace:(/styles/.+):http\\://userstyles.org$1}</TextualContent>
            <Name>durl_userstyles</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>durl_userscripts</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{durl}</TextualContent>
            <Name>durl_userscripts</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <Category>Extensions\Greasemonkey</Category>
    <SourceType>FixedUrl</SourceType>
    
    <DeletePreviousFile>false</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    
    <TargetPath>{target}\{category}\{appname:replace: :}_{version:regexreplace:([A-Za-z]+) +(\d+),? +(\d+):$2-$1-$3}.{url:ext}</TargetPath>
    <FixedDownloadUrl>{durl_<placeholder name="Userscripts OR Userstyles ? (use characters in lowercase only)" />}</FixedDownloadUrl>
    <Name><placeholder name="AppName" /></Name>
  </ApplicationJob>
</Jobs>

Note: tested only with *.user.js files in Userscripts.org and in Userstyles.org

Last edited by FranciscoR (2009-06-26 17:37:56)

Re: Greasemonkey Scripts Template (test)

Will try this when time allows FranciscoR... I'm swamped with work these days...

Re: Greasemonkey Scripts Template (test)

I've only tested it with Javascript files... wink