Jump to content
Ketarin forum

Greasemonkey Scripts Template (test)


FranciscoR
 Share

Recommended Posts

<?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

Edited by FranciscoR
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.