File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ from bs4 import BeautifulSoup
2+ import requests
3+ import shutil
4+ page = requests .get ("http://planet.dgplug.org/" )
5+ soup = BeautifulSoup (page .content , 'html.parser' )
6+ data = soup .find_all (class_ = "entrygroup" )
7+ columns = shutil .get_terminal_size ().columns
8+ size = len (data )- 1
9+ for i in range (0 , size ):
10+ piu = data [i ]
11+ heading = piu .find ("a" ).get_text ()
12+ for n in range (84 ):
13+ print ("-" , end = " " )
14+ print ('{}{}' .format (' ' * (int (columns / 2 - len (heading ) / 2 )), heading ))
15+ for n in range (84 ):
16+ print ("-" , end = " " )
17+ main_content = piu .find (class_ = "content" ).get_text ()
18+ print (main_content )
Original file line number Diff line number Diff line change @@ -96,6 +96,14 @@ In case your browser stoped working delete/comment the following line in the scr
9696#### _ Windows_
9797 ` os.system("TASKKILL /F /IM " + brow + ".exe") `
9898
99+
100+ ### Blog Reader
101+
102+ Blog Reader is the terminal reader that scrapes the article from [ planet dgplug] ( http://planet.dgplug.org/ ) and displays it on the terminal.
103+
104+ It seprates the content accrding to the screen size.
105+
106+
99107## Release History
100108
101109* 0.0.1
@@ -125,3 +133,4 @@ The following people helped in creating the above content.
125133* <a href =" https://github.com/Logan1x " target =" _blank " >Khushal Sharma</a >
126134* <a href =" https://github.com/KayvanMazaheri " target =" _blank " >Kayvan Mazaheri</a >
127135* <a href =" https://github.com/kalbhor " target =" _blank " >Lakshay Kalbhor</a >
136+ * <a href =" https://github.com/Pradhvan " >Pradhvan Bisht</a >
You can’t perform that action at this time.
0 commit comments