Python · Scripts

Scripts : Making life a bit easier

This blog post is about some scripts, that I have coded to make life a bit free from stuff, that can be easily automated.

While working on these scripts I got to know about lot of cool APIs, some more of Python, some shell and about Lynx.

I’ll be adding more and more. There are a lot of tasks that can be easily scripted, making life a bit easier.

Some scripts that might be useful to you :

1. If you want to know the meaning of a word with example sentences, use this. It’s fun. It’s cool. It will give you the output on the console. Let me know if anything irritates you while using this script.

2. Want to learn a word a day, I wanted to, that’s why I created a script. You can also use this script too . Have fun.

3. A script which can download Youtube videos for you. You can also fetch more information about any video using this script.

4. Want to make a webpage ? But just a second you don’t know how to write HTML. Use this script to generate a HTML webpage.

It will ask you to give the titles and links and it will the generate the webpage for you, added with a Google search bar and a motivating penguin marqueeing all the way.

 

The output looks something like this :

Generate-HTML-Page
Sample Output

 

Cool right. I also had fun while coding it. 🙂

 

Something for  people like me :

1. How many times you get  JSON output like this crap  :

{"COLUMNS":["ID","TITLE","POSTED"],"DATA":[["905D9689-0130-1A16-62272F586A771C0C","mmm","May, 15 2007 10:31:00"],["905DAAED-E300-3B9D-7E25E43985CA9507","nn","May, 15 2007 10:31:00"],["905DE931-B8DB-B1AD-F77FC505851C2E9A","j","May, 15 2007 10:31:00"],["905E0C6A-99B8-97EC-4862D9064B9EC659","mmmmm","May, 15 2007 10:31:00"],["905E5910-0E2D-C566-5DCD39E6FD48ED06","NUMBER 11","May, 15 2007 10:32:00"]]}

Use this script as :

python PrettyPrintJSON.py inputfile.txt outputfile.txt

and you will get a file having pretty printed JSON like :


{
"DATA": [
[
"905D9689-0130-1A16-62272F586A771C0C",
"mmm",
"May, 15 2007 10:31:00"
],
[
"905DAAED-E300-3B9D-7E25E43985CA9507",
"nn",
"May, 15 2007 10:31:00"
],
[
"905DE931-B8DB-B1AD-F77FC505851C2E9A",
"j",
"May, 15 2007 10:31:00"
],
[
"905E0C6A-99B8-97EC-4862D9064B9EC659",
"mmmmm",
"May, 15 2007 10:31:00"
],
[
"905E5910-0E2D-C566-5DCD39E6FD48ED06",
"NUMBER 11",
"May, 15 2007 10:32:00"
]
],
"COLUMNS": [
"ID",
"TITLE",
"POSTED"
]
}

2. Many times I get very poorly indented HTML files, poor like I cannot even understand a bit.  Do you face the same problem? Do you want them to be pretty printed too. You can use this or this to pretty print HTML files.

3. Want to avoid doing all this again and again :

git add -A
git commit -m 'Your Message'
git push origin master

Use this script and you only need to give the commit message, and the script handle everything by it’s own.

 

Something for fun :

1. This script gives you current weather for your location on the console.

2. This script locates you. It will give you your current location, your city, country, region, lat and long.

 

Some more help here.

 

It’s code that completes me . ❤

Advertisements

One thought on “Scripts : Making life a bit easier

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s