Giter Site home page Giter Site logo

terminal-share's Introduction

terminal-share

Mac OS X Sharing Services... As A Service

Mac OS X 10.8 Mountain Lion introduced built-in sharing. Access to this system-level feature is provided through NSSharingService.

It does everything from posting to Twitter, Facebook, Flickr, Vimeo, & YouTube, to adding content to your Safari Reading List or iPhoto or Aperture Library, as well as sending files over airdrop or e-mail. It even supports Chinese web services like Sina Weibo, Tu Dou, & YouKu.

terminal-share extends access to these APIs by proxying through a simple command-line application. Normally, Apple would provide such a Unix command-line interface through a Foundation Tool.

Ruby

$ gem install terminal-share

This will also install the terminal-share executable.

require 'terminal-share'

TerminalShare.share(:twitter, text: "This was shared from the command-line, courtesy of terminal-share, by @mattt", url: "https://github.com/mattt/terminal-share")

Screenshot

Command Line

$ terminal-share -service NAME              \
                [-text text]                \
                [-image /path/to/image]     \
                [-video /path/to/video]     \
                [-url "http://example.com"]

Arguments

  • service: (Required) A short string corresponding to the name of a particular NSSharingService to be used. Available values:
    • twitter - NSSharingServiceNamePostOnTwitter
    • sinaweibo - NSSharingServiceNamePostOnSinaWeibo
    • email - NSSharingServiceNameComposeEmail
    • message - NSSharingServiceNameComposeMessage
    • airdrop - NSSharingServiceNameSendViaAirDrop
    • readinglist - NSSharingServiceNameAddToSafariReadingList
    • iphoto - NSSharingServiceNameAddToIPhoto
    • aperture - NSSharingServiceNameAddToAperture
    • facebook - NSSharingServiceNamePostOnFacebook
    • flickr - NSSharingServiceNamePostImageOnFlickr
    • vimeo - NSSharingServiceNamePostVideoOnVimeo
    • youku - NSSharingServiceNamePostVideoOnYouku
    • tudou - NSSharingServiceNamePostVideoOnTudou
  • text: (optional) Text to be shared.
  • image: (optional) File path to an image to be shared.
  • video: (optional) File path to a video to be shared.
  • url: (optional) URL to be shared.

Not all services support sharing of all types of content. See the NSSharingService Documentation for additional guidelines.

Example

$ terminal-share -service twitter \
                 -text "This was shared from the command-line,  \
                        courtesy of terminal-share, by @mattt"  \
                 -url "https://github.com/mattt/terminal-share"

Creator

Mattt Thompson (@mattt)

Credit

Thanks to Eloy Durán for his work on terminal-notifier, which was used as inspiration and a guideline for how to use the Script Bridge APIs.

License

terminal-share is available under the MIT license. See the LICENSE file for more info.

terminal-share's People

Contributors

mattt avatar maclemon avatar

Watchers

Rafael Prado avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.