An image upload droplet for Mac OSX, written in Applescript and PHP
How to use?
- Get the TinyDrop app from the Downloads section of this repository, or build it yourself.
- Place the app in your Applications folder.
- Drag the app to your dock, to have an icon in the dock.
- Now you can just drag and drop one or more images on the application icon in your dock, to start uploading them to the active image host.
- To change hosts, just run the application and select one.
How to build?
- Open TinyDrop.scpt in the AppleScript Editor
Save as...from the menu
- Right click the new 'TinyDrop' Appliciation, and choose 'Show package content'
- Find your way to
Contents > Resourcesand paste the contents of this repository there.
- Put the TinyDrop app in your dock and enjoy it!
How to add plugins?
TinyDrop uses a plugin system to support multiple image hosts. These plugins are just simple php classes to give the TinyDrop system a clue about how to work with certain hosts.
The plugins must follow these conventions:
- The filename must be the same as the class name, followed by
.tdpi.php. For example if you create a plugin for host
X, your class will be called
Xand the file will be called
- Plugins reside in the
pluginsdirectory inside the app.
Contents > Resources > plugins
- Plugins must extend the TDPlugin class, to inherit basic functionality
There are three obligated methods for plugins
__constructin which you set the
urlclass property to the (api) POST url.
postDatareturning an array of post variables for our (api) call. We call this method with one argument, the path of the image we want to upload.
parsereturning the url of the uploaded image. We call this method with one argument, the plain response of the (api) call.