Notes concerning Tweet-From-Terminal
Tweet-From-Terminal is a concept for a terminal application that takes direct input from terminal commandline. Unlike other programs that create an interface for Python input, the goal of Tweet-From-Terminal is to create a program that takes input from the commandline alone without an user interface that asks the user to type in the message. This would allow users to automate tweets on their terminal using just output from other programs.
An example of how this would work and be beneficial is when someone is writing a blog post on JLJ. JLJ gives the user the posted URL as an output. If I had a script that ran a query to see if the user wants social media interaction, it could post automatically to Twitter, which can be easily connected with most popular social media sites. This will allow you to make updates of your blog more public and available to the others who reside elsewhere on the net (everyone not using Dreamwidth, which is probably a plurality of people now).
The only problem I’m really facing right now is that when you go to take text, Python seems to translate all argv into lists. This is good for usual functions, but since my function is just reading direct input from the commandline, Python’s default function doesn’t work. To solve this problem, I tried converting the default to a string. The first problem I ran into was that many “good” methods is to simply strip the array format and creating a string from the stripped array. So instead of just removing the array-related brackets and commas, it removes ALL brackets and commas. This is no good if the user ever uses a comma or a bracket in an actual post.
Another issue I ran into was that Python doesn’t seem to understand how to take in a certain amount of words or question marks by themselves. I wonder if this is something I can overcome… as the program simply failed to execute after typing in “Does this work?” Python informed me, no, no it doesn’t. :(
I will keep playing with this. I wonder if C would have an advantage here? Or perhaps Perl?