function - Is there a twitter functionality to be selective with retweets?

29
2013-07
  • Christopher Chipps

    At times, there are tweets that I would deem appropriate to retweet to specific lists or only to certain followers. I've had much experience using Twitter and third party programs like Tweetdeck but it seems like a broad brush is painted when it comes to retweets, it's either all or nothing. Is there something I haven't looked into and "specific retweeting" exists?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.


    view all most popular Amazon Coupons
    .

    Related Question

    Is a shell function better than the same function in PATH?
  • Masi

    I have been slightly confused about the extraneous use of shell functions.

    My definition of a shell function: a function which is in .bashrc such that

    .bashrc

    --- other default bash configs ----
    
    extract() {     // I call this a shell function
       ....
    }
    

    My definition of a function put to PATH: a file which folder is at PATH. For example, we have the file ~/bin/screen/convert.screen

    To add the file and other files in the folder to my PATH, I can have the following PATH

     export PATH='/Users/masi/bin/screen:'
    


    I would like to know when I should put the function as a login shell function and when to my PATH. I prefer the latter at the moment, since the former increases costs of maintenance.

    Which is the advantage of an user-made shell function that a function in your PATH does not have?


  • Related Answers
  • John T

    Shell functions are easily modified and maintained. You should add these to your PATH when you know you will always need them (even if it's much less often), as opposed to a temporary thing. There is no need to load such a large rc file that you keep adding to when you know you won't need everything in it all the time. If there is a large function you use less often but it is very important, make it accessible from your PATH so you can access it only when you need it.

  • nik

    It would help if you agreed with the more accepted description of the shell function as a function written in a file (script) that can be sourced to load in to your shell and used in other scripts and shell commands.

    If we take this interpretation of the term, then shell functions make your life easier with 'functions' in your scripts and commands.

    Going further, you might also consider writing your less frequently used 'functions' in a separate file and storing that with your other scripts. When you need these you could just source that script into your shell.

  • Telemachus

    I use shell functions for things that are reasonably small and self-contained, and that are helper commands for the shell rather than full programs in their own right. Once something becomes a proper program, I write it up as such and move it to the bin directory in my $HOME folder (which is already in my PATH).

    Here's an example:

    # Start mpd (if necessary), search for music using mpc, play music.
    mp-start()
    {
        ps -C mpd > /dev/null || mpd
        mpc search any $1 | mpc add -
        mpc play
    }
    

    That's a function not a program. There's very little to it, and I'm only going to use it if I'm already working in the shell.

    I also find it cleaner to put all the functions for my shell into a separate file (.bash_functions for me, but I think you are a Z shell user, so adjust accordingly) which I source from my shell's primary rc file. A last tip is to add something like this to your aliases:

    alias refunction='vim ~/.bash_functions; source ~/.bash_functions'
    

    That allows you to create a new function on the fly and have it be immediately available once you're done editing.