Python Script 7: Scraping tweets using BeautifulSoup

Twitter is one of the most popular social networking services used by most prominent people of world. Tweets can be used to perform sentimental analysis.

In this article we will see how to scrap tweets using BeautifulSoup. We are not using Twitter API as most of the APIs have rate limits.

Continue reading “Python Script 7: Scraping tweets using BeautifulSoup”

Get latest Bitcoin and other crypto-currencies rates using python Django

Everybody is investing in bitcoins. James Howells is trying to dig a landfill site to get 7500 bitcoins that were dumped there in 2013.

To be a good investor, it is necessary that you keep track of ups and downs in the market. There are multiple platforms where you can track the price of bitcoin. But for a python programmer that is no fun. Being a python programmer we will develop our own project where we can get latest bitcoin and other crypto-currency prices.

Let’s start.

Continue reading “Get latest Bitcoin and other crypto-currencies rates using python Django”

Python Script 6: Wishing Merry Christmas using Python Turtle

Merry Christmas everyone.

Since this is Christmas today, I thought of wising everyone in a different way. I am python programmer and I love writing code so I decided to do something with python and after 1 hour I was ready with the below script to wish all of you Merry Christmas using python turtle.

Code is available on Github as well.

Code :
 

Output Video:

Happy learning.

 

Reference:
[1] https://coolpythoncodes.com/python-turtle/
[2] https://docs.python.org/3.6/library/turtle.html

How to backup database periodically on PythonAnyWhere server

You can host your Django app effortlessly on PythonAnyWhere server. If you are using the database in your app then it is strongly recommended to take backup of database to avoid loss of data.

This PythonAnyWhere article explain the process to take sql dump. We will extend the same article to take database backup periodically and delete the old files.

Continue reading “How to backup database periodically on PythonAnyWhere server”

Python Script 5: How to find most popular technologies on Stackoverflow

This script crawls the Stackoverflow pages to find the most popular technology by counting the number of tags on each question.

Important: Please do not send too many requests. Respect the robot.txt file.

Code is also available on Github.

You will require to install beautifulsoup  and requests  python package.

Code:
 

best python scripts

Other Scripts:

Opening top 10 Google search results in one hit.
Formatting and validating JSON.
Crawling all emails from a site.

 

Python Script 4: Opening top 10 Google search result in one hit

This is the fourth script in ‘Python Scripts’ series. You can have a look at previous scripts by following the links given below.

Python Script 3: Validate and format JSON string
Python Script 2: Crawling all emails from a website
Python Script 1: Convert ebook from one format to another

As the title suggest, this script is used to open top 10 Google search results in different tabs for provided keyword.

Code:
 

I am using this same concept at my work. Every day I have to open 8 applications (slack, JIRA, gitlab, Facebook :p, stackoverflow, Jenkins UI, Outlook and Personal Email) in my browser. So instead of opening each application one by one, I just run the script and all these applications are opened in different tabs saving few seconds :D.

 

 

How to create completely automated telegram channel with python

In this article we will see how to create a completely automated telegram channel. To demonstrate the process we will take through the example of a telegram channel News India (https://t.me/newsindiachannel) created by me which post news every hour.

The automated process of generating content and posting on the channel is divided into three parts. Creating telegram channel and bot, generating/fetching content using python script and posting the content to telegram channel.

Creating telegram channel and Bot:

-Install telegram app from Google Play.
-After you are done with initial setup. Click on menu and create a new channel.

Continue reading “How to create completely automated telegram channel with python”

Python Script 2 : Crawling all emails from a website

This is the second article in the series of python scripts. In this article we will see how to crawl all pages of a website and fetch all the emails.

Important: Please note that some sites may not want you to crawl their site. Please honour their robot.txt file. In some cases it may lead to legal action. 
This article is only for educational purpose. Readers are requested not to misuse it. 
Continue reading “Python Script 2 : Crawling all emails from a website”

Python Script 1: Convert ebooks from epub to mobi format

We are starting a series of python scripts which we may use in our daily life to automate mundane task and save some time.

This is the first article in this series. Recently I bought Amazon’s Ebook Reader, kindle paperwhite 3. I purchased few books from kindle store and downloaded most of the books in Epub format. Now kindle doesn’t support epub format. You need to convert them to either mobi or azw3 format.

Continue reading “Python Script 1: Convert ebooks from epub to mobi format”