The Following User Says Thank You to pinguino89 For This Useful Post: | ||
![]() |
2009-11-25
, 19:54
|
Posts: 183 |
Thanked: 18 times |
Joined on Jul 2009
@ italy
|
#2
|
![]() |
2009-11-27
, 15:21
|
|
Posts: 354 |
Thanked: 151 times |
Joined on Mar 2008
@ London (UK) / Zielona Góra (PL)
|
#3
|
![]() |
2009-11-27
, 15:54
|
Posts: 183 |
Thanked: 18 times |
Joined on Jul 2009
@ italy
|
#4
|
![]() |
2009-12-07
, 00:08
|
Posts: 72 |
Thanked: 31 times |
Joined on Oct 2009
@ Germany
|
#5
|
![]() |
2010-01-06
, 08:41
|
Posts: 1 |
Thanked: 0 times |
Joined on Jan 2010
|
#6
|
![]() |
2010-01-17
, 23:02
|
Posts: 468 |
Thanked: 610 times |
Joined on Jun 2006
|
#7
|
![]() |
2010-02-05
, 13:38
|
Posts: 38 |
Thanked: 17 times |
Joined on Jun 2008
|
#8
|
#!/usr/bin/env python # -*- coding: utf-8 -*- # Read from Firefox/Microb the visited sites and output it in html format. # Version 1.03 04.02.2010 # maemouser@wolke7.net URL_DISPLAY_LEN = 30 # longer URLs are truncated for display DISPLAY_MAX_LINES = 50 # max. number of visited sites to display import sys, sqlite3 sql = '''SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url, moz_places.title FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id ORDER BY moz_historyvisits.visit_date DESC; ''' fatal_err = False try: db = sqlite3.connect('/home/user/.mozilla/microb/places.sqlite') except: fatal_err = True print 'could not open places DB' if not fatal_err: try: res = db.execute(sql).fetchall() except sqlite3.OperationalError, errmsg: # DB locked because browser is running fatal_err = True #print errmsg print 'please close browser first' try: db.close() except: pass if fatal_err: sys.exit(1) print '''<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <table border> ''' z = 0 for row in res: z += 1 print '<tr>' for col in row: print '<td>' try: col = str(col) except UnicodeEncodeError: col = col.encode('utf-8') if ('http://' in col) or ('https://' in col): coltxt = col.lstrip('https:').lstrip('http:').lstrip('//') # remove the protocol part if len(coltxt) > URL_DISPLAY_LEN: coltxt = coltxt[:URL_DISPLAY_LEN] + '…' # add three dots (ellipsis) print '<a href="%s">%s</a>' % (col, coltxt) else: print col print '</td>' print '</tr>' if z == DISPLAY_MAX_LINES: break # stop displaying print '</table></html>'
#/bin/sh d=/opt/placesupload echo starting /usr/bin/run-standalone.sh $d/placeslist.py > $d/places.html if test $? -eq 1; then # script returned an error cat $d/places.html exit 1 fi scp $d/places.html root@myserver.ch:/var/nokiaupload/ date "+%a %H:%M:%S"
![]() |
2010-02-05
, 13:44
|
|
Posts: 963 |
Thanked: 626 times |
Joined on Sep 2009
@ Connecticut, USA
|
#9
|
Who needs Weave... I did a simple script to read visited places from microb's sqlite database and upload it to my Linux vserver.
- Python must be installed on the N900
- SSH client must be installed on the N900
- you need a Linux server in the Internet with OpenSSH installed
- password less (public/private key) access must be set up (on N900 ssh-keygen, then copy public key to server in .ssh/authorized_keys)
Place the two scripts in the /opt/placesupload folder on the N900.
python script:
shell script which calls the above python script:Code:#!/usr/bin/env python # -*- coding: utf-8 -*- # Read from Firefox/Microb the visited sites and output it in html format. # Version 1.03 04.02.2010 # maemouser@wolke7.net URL_DISPLAY_LEN = 30 # longer URLs are truncated for display DISPLAY_MAX_LINES = 50 # max. number of visited sites to display import sys, sqlite3 sql = '''SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url, moz_places.title FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id ORDER BY moz_historyvisits.visit_date DESC; ''' fatal_err = False try: db = sqlite3.connect('/home/user/.mozilla/microb/places.sqlite') except: fatal_err = True print 'could not open places DB' if not fatal_err: try: res = db.execute(sql).fetchall() except sqlite3.OperationalError, errmsg: # DB locked because browser is running fatal_err = True #print errmsg print 'please close browser first' try: db.close() except: pass if fatal_err: sys.exit(1) print '''<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <table border> ''' z = 0 for row in res: z += 1 print '<tr>' for col in row: print '<td>' try: col = str(col) except UnicodeEncodeError: col = col.encode('utf-8') if ('http://' in col) or ('https://' in col): coltxt = col.lstrip('https:').lstrip('http:').lstrip('//') # remove the protocol part if len(coltxt) > URL_DISPLAY_LEN: coltxt = coltxt[:URL_DISPLAY_LEN] + '…' # add three dots (ellipsis) print '<a href="%s">%s</a>' % (col, coltxt) else: print col print '</td>' print '</tr>' if z == DISPLAY_MAX_LINES: break # stop displaying print '</table></html>'
To make uploading a single click, I am using the "Desktop Command Execution Widget":Code:#/bin/sh d=/opt/placesupload echo starting /usr/bin/run-standalone.sh $d/placeslist.py > $d/places.html if test $? -eq 1; then # script returned an error cat $d/places.html exit 1 fi scp $d/places.html root@myserver.ch:/var/nokiaupload/ date "+%a %H:%M:%S"
Add a cmd, select "Update when clicked", Update Interval 0, Only when connected, command: "/opt/placesupload/placesupload.sh".
![]() |
2010-04-06
, 23:56
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#10
|
is there a possibility to port Mozilla Weave not only to MicroB Fremantle but to the diablo one too???
and what about other plug-ins?? I use several plugin on my firefox...some of that will be useful on the NiT ^_^