lieutar / mechanize-userscripts.org

userscripts.org のスクリプトをCLIで更新するためのもの
2 stars 1 forks source link

Metadata #14

Open alexandre-mbm opened 10 years ago

alexandre-mbm commented 10 years ago

Send

Integration

The entire addition can come out from a conditional inside the sub list.

alexandre-mbm commented 10 years ago

It is basically add the --auto and --meta options (ref.: Getopt::Long); but also other.

prog --help               help
prog                      list IDs and names
prog --auto               update using metadata
prog --meta               send metadata only
prog --diff               do diff with temporary directory downloaded
prog --info               show basic info to compare (metadata and file attributes)
prog --set                install or search the script
prog --get                get the script that is installed
prog FILE                 upload
prog ID FILE              update

Propose of $ENV{PWD}/userscript-metadata.json:

{
           "id" : 1234,           
       "script" : "FILENAME.js",

       "deploy" : {
                             "type" : "firefox",                             
                        "directory" : "DIRECTORY"                           
                  },

         "name" : "lorem ipsu lorem ipsu",
      "summary" : "lorem ipsu lorem ipsu lorem ipsu lorem ipsu",

  "description" : "FILENAME.md",
  "description" : "FILENAME.htm",

         "icon" : "FILENAME.png",

      "license" : "BSD",
      "license" : "MIT",
      "license" : "GPL",
      "license" : "LGPL",
      "license" : "OSI",
      "license" : "CC",
      "license" : "PUBLIC",
      "license" : "PROPRIETARY",

     "homepage" : "http://...",
     "location" : "http://...",

         "tags" : [ "TAG1", "TAG2", "TAG3" ],

  "screenshots" : [
                     {
                           "file" : "FILENAME.png",
                        "caption" : "lorem ipsu lorem ipsu"
                     },
                     {
                           "file" : "FILENAME.png",
                        "caption" : "lorem ipsu lorem ipsu"
                     }
                  ], 

         "load" : {
                           "basic" : true,
                            "icon" : false,
                            "tags" : true,
                     "screenshots" : false
                  }
}
alexandre-mbm commented 10 years ago

One command as find using grep -v "config-*" | grep -v "~$" informs:

~/.mozilla/firefox/{profile}/gm_scripts/{directory}
~/.mozilla/firefox/{profile}/gm_scripts/{directory}/{dependence1}.js
~/.mozilla/firefox/{profile}/gm_scripts/{directory}/{dependence2}.png
~/.mozilla/firefox/{profile}/gm_scripts/{directory}/{dependence2}.css
~/.mozilla/firefox/{profile}/gm_scripts/{directory}{script}.js

Changes proposed:

~/.post-userscripts-org/accounts.json
~/.post-userscripts-org/profiles.json

profiles.json

{
  "firefox" : {
    "9pbqno3j.default" : {
      "default" : true,
      "manager" : "gm_scripts"
    }
  }
}