I was just thinking about making an rss bot in telegram, and wrote a small python script which can fetch rss feeds from the feed link and prints the result with “Title” and “Link”.
if len(sys.argv) < 2:
print("USAGE: python feedparse.py <rss feed link>")
rss_url = sys.argv
feed = feedparser.parse( rss_url )
y = len(feed[ "items" ])
for x in range(0,y):
print('\033[91m'+feed[ "items" ][x][ "title" ] + '\033[0m', "-", feed[ "items" ][x][ "link" ])
Below example shall print the feeds available in Mobilecrunch.
$ python feedparse.py http://feeds.feedburner.com/Mobilecrunch
Newest code will be available in gist if I forget to update this blog.
There is a famous command line tool called youtube-dl to download videos from youtube, and its an opensource project written in python and available for Linux, windows and OSX platforms.
In Linux, you can install the tool using:
$ sudo pip install –upgrade youtube-dl
To download a video from a link:
$ youtube-dl <Your Video link>
Example: youtube-dl https://www.youtube.com/watch?v=pRpeEdMmmQ0&list=RDpRpeEdMmmQ0
It will get donwloaded in $PWD.
To download mp3 from a link:
$ youtube-dl –extract-audio –audio-format mp3 <Your Video Link>
Example: youtube-dl –extract-audio –audio-format mp3 https://www.youtube.com/watch?v=krpm0DaeLnI
It will get downloaded in $PWD.
Do “youtube-dl -h” for more help on formats and other features.
Like youtube-dl there is a command line tool called scdl, which is written in python based on GPLV2 license and works on Linux, windows and OSX.
To install in linux, execute below command:
$ pip install scdl
To download a single song:
$scdl -l <Sound cloud link to the song>
Example: scdl -l scdl -l https://soundcloud.com/trdp/raghu-dixit-jagchanga-lokada
It will download and store in $PWD
Do “scdl -h” to know other options like download complete album, user liked videos etc.
In this blog I will be posting stuffs related to linux, kernel, device-drivers, raspberry-pi, arduino, beaglebone, POSIX, C-Programming, Labview etc…..