#python
import webbrowser
a = ['http://www.google.com/reader','http://www.yahoo.com/','http://www.facebook.com/']
for x in a:
webbrowser.get('firefox').open_new_tab(x)
You just need to copy and paste that code into a text file and save it as something like "opensite.py" (better to use the .py extension)
Make it executable running the following command in terminal:
sudo chmod a+x opensite.py
Run it either in the command line with
python /path/to/opensite.py
Or create a launcher (you can do this in Ubuntu easily by right clicking on the desktop)
hi man. i would realy apreciate if you can tell me what is the problem with this script what it supose to do is to request a webpage in regular intervals without using a browser ty man..
ReplyDeleteimport urllib #isxoroume stin vivliothiki urllib
import time #ishoroume stin vivliothiki time (gia na rithmisoume to w8 time pou tha trexei )
link = ('http://forfreeprogram.blogspot.gr/','')
#mesa sta komma vazoume ta link pou theloume na kanei request
link_pos = 0
request_count = 1
while True:
try:
if request_count == 2:
link_pos = link_pos + 1
request_count = 0
request_count = request_count + 1
time.sleep(480)
urllib2.urlopen(link_pos) #afti i entoli kanei request to link
except:
pass
else:
pass
I would but I'm not very good at debugging... Try http://stackoverflow.com/
Deleteactually the program is runing but is not doing what is suposed to do... a cyber friend of a friend of mine rote this code... you think you can make somthing similar to this and we can try it and benefit as bolth i have a sertain way i am gonna use it ;)
DeleteThis comment has been removed by the author.
ReplyDelete