3
13
2014
1

我的浏览器A到Z

本文来自依云's Blog,转载请注明。

Re: 的确挺好玩的~

那个 frecency 懒得去研究是干什么用的,大概是频度之类的?frecency 即是火狐地址栏著名的 frecency 算法的值。

A
标题:工作台 - Chito
URL:http://lilydjwg.is-programmer.com/admin
访问次数:1828
frecency:3564600
最后访问日期:2014-03-13 21:26:42

B
标题:搜索结果 (页 1) / Arch Linux 中文论坛
URL:https://bbs.archlinuxcn.org/search.php?action=show_new
访问次数:1550
frecency:3100000
最后访问日期:2014-03-13 21:47:33

C
标题:Twitter / Interactions
URL:https://twitter.com/i/connect
访问次数:673
frecency:1063004
最后访问日期:2014-03-13 20:30:28

D
标题:豆瓣
URL:http://www.douban.com/
访问次数:290
frecency:212507
最后访问日期:2014-02-26 21:34:39

E
标题:所有消息 - SegmentFault
URL:http://segmentfault.com/user/events
访问次数:298
frecency:539380
最后访问日期:2014-03-13 21:44:30

F
标题:Index of /ftp/python
URL:http://python.org/ftp/python/
访问次数:7
frecency:2614
最后访问日期:2014-02-19 23:45:13

G
标题:Gmail
URL:https://mail.google.com/mail/
访问次数:396
frecency:449053
最后访问日期:2014-02-28 20:26:26

H
标题:工作台 - Chito
URL:http://lilydjwg.is-programmer.com/admin
访问次数:1828
frecency:3564600
最后访问日期:2014-03-13 21:26:42

I
标题:依云's Blog
URL:http://lilydjwg.is-programmer.com/
访问次数:100
frecency:126258
最后访问日期:2014-03-09 23:28:52

J
标题:jQAPI - Alternative jQuery Documentation Browser
URL:file:///home/lilydjwg/%E6%96%87%E6%A1%A3/%E7%BD%91%E9%A1%B5/Javascript/jqapi_2013-01-21/index.html
访问次数:5
frecency:1446
最后访问日期:2013-12-18 02:25:01

K
标题:The Linux Kernel Archives
URL:http://kernel.org/
访问次数:41
frecency:33347
最后访问日期:2014-03-02 21:47:12

L
标题:Lua 5.2 Reference Manual - contents
URL:file:///usr/share/doc/lua/contents.html#index
访问次数:24
frecency:14682
最后访问日期:2014-03-05 21:47:52

M
标题:Google 地图
URL:https://maps.google.com/
访问次数:83
frecency:52035
最后访问日期:2014-03-12 19:30:50

N
标题:None
URL:http://lilydjwg.is-programmer.com/admin/posts/new
访问次数:24
frecency:33600
最后访问日期:2014-03-13 22:08:35

O
标题:查看版面 - Vim和Emacs • Ubuntu中文论坛
URL:http://forum.ubuntu.org.cn/viewforum.php?f=68
访问次数:236
frecency:166138
最后访问日期:2014-03-02 22:26:47

P
标题:Python Module Index — Python v3.3.0 documentation
URL:file:///home/lilydjwg/%E6%96%87%E6%A1%A3/%E7%BC%96%E7%A8%8B/Python/python/py-modindex.html
访问次数:124
frecency:169744
最后访问日期:2014-03-10 23:10:46

Q
标题:Qt 4.8:
URL:jar:file:///home/.ecryptfs/lilydjwg/public/%E6%96%87%E6%A1%A3/%E7%BC%96%E7%A8%8B/qt4-doc/qt4-doc.zip!/index.html
访问次数:9
frecency:5198
最后访问日期:2014-03-06 22:05:35

R
标题:InoReader • 轻便快捷的 RSS 阅读器
URL:https://www.inoreader.com/
访问次数:155
frecency:177119
最后访问日期:2014-03-12 22:41:51

S
标题:SegmentFault
URL:http://segmentfault.com/
访问次数:1486
frecency:411473
最后访问日期:2014-03-13 20:47:13

T
标题:Google 翻译
URL:http://translate.google.cn/?hl=zh-CN
访问次数:138
frecency:145314
最后访问日期:2014-03-11 23:50:21

U
标题:Pinboard: public bookmarks for vayn
URL:http://pinboard.in/u:vayn
访问次数:13
frecency:5589
最后访问日期:2014-02-16 18:42:04

V
标题:查看版面 - Vim和Emacs • Ubuntu中文论坛
URL:http://forum.ubuntu.org.cn/viewforum.php?f=68
访问次数:236
frecency:166138
最后访问日期:2014-03-02 22:26:47

W
标题:新浪微博-随时随地分享身边的新鲜事儿
URL:http://weibo.com/
访问次数:78
frecency:117933
最后访问日期:2014-02-27 22:51:10

X
标题:None
URL:http://localhost/xcache/
访问次数:6
frecency:6688
最后访问日期:2014-03-02 22:50:15

Y
标题:soimort/you-get
URL:https://github.com/soimort/you-get
访问次数:24
frecency:19374
最后访问日期:2014-03-07 21:13:24

Z
标题:消息 - 知乎
URL:http://www.zhihu.com/notifications
访问次数:528
frecency:823165
最后访问日期:2014-03-09 16:53:10


附:从 URL 生成这些数据的代码。当然,还有后期处理,是用 Vim 简单地做了几次正则替换。

#!/usr/bin/env python3

import os
import sys
import sqlite3
from time import strftime, localtime

places = os.path.expanduser('~/.mozilla/firefox/profile/places.sqlite')

def main():
  db = sqlite3.connect(places)
  sql = '''select title, visit_count, frecency, last_visit_date
           from moz_places where url = ? limit 1'''
  c = db.cursor()

  for url in sys.stdin:
    url = url.strip()
    c.execute(sql, (url,))
    title, visit_count, frecency, last_visit_date = c.fetchall()[0]
    print('''\
标题:%s
URL:%s
访问次数:%d
frecency:%d
最后访问日期:%s
''' % (title, url, visit_count, frecency,
       strftime('%Y-%m-%d %H:%M:%S', localtime(last_visit_date//1000000))))

if __name__ == '__main__':
  main()

又附:上边的代码忘记写是哪个字母了 -_-||| 已经补上,用了个 Vim 宏来完成。话说好久没用 Vim 宏了呢~

Category: 未分类 | Tags: 程序员 火狐 浏览器 | Read Count: 8674

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

| Theme: Aeros 2.0 by TheBuckmaker.com