Skip to content

frcepeda/LetsCrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Let's Crate's API hasn't been working for months now. :( They haven't replied to my emails about it, so I have no idea whether they intend to bring it back.

LetsCrate

This is an unofficial command line client for Let's Crate.

Please let me know what you think! You can reach me at [email protected].

Quick start manual

To use this program, you need to create an account at Let's Crate and to install Typhoeus, as well as JSON. You can do that with gem install typhoeus; gem install json in your command line.

The first time you run it, you have to use the "-l" switch with your login information. It will then ask you if you want to save the credentials at ~/.config/letscrate/config so you don't need to keep typing them every time you use the program.

Example:

letscrate.rb -l username:password  
letscrate.rb -l "username:password"

After that, you can select an action from the list below and use the command normally.

You can use multiple files, names or crates in the commands whose descriptions are in plural.

If you use the --regexp function with the commands marked with an asterisk, every argument will be treated as a regular expression. The search and the list options use regular expressions by default.

Usage

Usage: letscrate.rb <-l username:password> [options] file1 file2 ...
   or: letscrate.rb <-l username:password> [options] name1 name2 ...

Mandatory arguments:
-l, --login [username:password]  Login with this username and password

File functions:
-u, --upload [Crate name]        Upload files to crate
-r, --delete                     Delete files with names *
-a, --list                       List all files
-d, --download                   Download files with names *
-s, --search                     Search for files with names
-i, --id                         Show files with IDs

Crate functions:
-N, --newcrate                   Create new crates with names
-A, --listcrates                 List all crates (or files in crates, if names are passed)
-D, --downloadcrates             Download crates with names *
-S, --searchcrates               Search for crates with names
    --renamecrate [Crate name]   Rename crate to name
-R, --deletecrate                Delete crates with names *

Misc. options:
    --regexp                     Treat names as regular expressions
-t, --test                       Only test the credentials
    --ids                        Print IDs when listing files/crates.
-v, --verbose                    Output extra info to the terminal
-q, --quiet                      Do not output anything to the terminal
    --version                    Output version
-h, --help                       Display this screen
    --debug                      Internal use only.

Tips

IDs

An ID is a 5+ digit identifier used internally by Let's Crate. To know the ID of your files, use the "--ids" option to list them with their respective URLs and IDs when executing any command.

For example, you can list all your crates and files with their IDs by typing letscrate.rb -l username:password -a --ids

Generally, you don't need to know the ID of a file, but if you do, you can use it instead of the name of the files/crates (it's faster).

You can also mix names with IDs whenever you want to.

If for some reason one of your files or crates is named with a 5 digit number, to stop this program from treating it as an ID, suffix it with a '$' (e.g. "34982$" will be treated as a name instead of an ID).

String Handling

You can type only a fragment of a crate or file's name if you know it's unique. Even if you don't specify the --regexp option, the program internally uses case insensitive regular expressions. For example, you can type only "yell" if one of your crates/files is called "Yellow.zip" and you know none of your other files have that exact string in them.

In the off chance that two names collide (e.g. "apple" and "apples with pears"), you can add a '$' to the end of the shorter one (e.g. "apple$").

What is a regular expression?

You can read about regular expressions in Wikipedia.

TO DO

  • Make this a Ruby Gem.
  • Do not store login info in plaintext.

Bugs

  • None yet, but please open a ticket (or email me) if you find one.

Quirky stuff

  • Let's Crate just added password verification for files (it was previously Crate only), which renders this application useless for downloading them. You can still upload, delete and list them, but you can't download them unless you use your browser.

License

Copyright (C) 2011 by Freddy Román

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

An unofficial command line client for Let's Crate.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages