Firefoxã®places.sqliteããGoogleã®æ¤ç´¢çµæãDELETEããShellãæ¸ãã¾ãã
ä»äºãªãç§ç¨ãªãããããããã¨ãã¯Vimperatorã®:[tab]openã§å±¥æ´ã辿ããã¨ãå¤ãã®ã§ããããªã¹ãã¢ãããããå±¥æ´ã«Googleã®æ¤ç´¢çµæãããã¨æ¬æ¥è¡¨ç¤ºãã¦æ¬²ããå±¥æ´ãåããã¦ãã¾ãå°ã
ä¸ä¾¿ã«æãã¦ãã¾ããã
ããã§ãFirefoxã®å±¥æ´ãä¿åããã¦ããplaces.sqliteããGoogleã®æ¤ç´¢çµæã«è©²å½ããã¬ã³ã¼ããDELETEããShellScriptãæ¸ãã¦ã¿ã¾ããã
#! /bin/sh # Firefoxãèµ·åãã¦ããã¨place.sqliteã¯lockããããæ´æ°(DELETE)ã§ããªãã®ã§ãèµ·åãã§ãã¯=>èµ·åãã¦ãããã¹ã«ã¼ if [ `ps -A | grep firefox-bin | wc -l`==0 ]; then sqlfile='/tmp/clean_places_sqlite.sql' # åé¤ãããurlã®ä¸é¨ words=" www.google.com/search www.google.co.jp/search " for word in ${words} do # åé¤å¯¾è±¡ã¨ãªããã¼ãã«ã¯ moz_historyvisits, moz_favicons, moz_places echo "DELETE FROM moz_historyvisits WHERE moz_historyvisits.place_id IN (SELECT moz_places.id FROM moz_places WHERE moz_places.url LIKE '%${word}%'); DELETE FROM moz_favicons WHERE moz_favicons.id IN (SELECT moz_places.favicon_id FROM moz_places WHERE moz_places.url LIKE '%${word}%'); DELETE FROM moz_places WHERE url LIKE '%${word}%';" >> ${sqlfile} done # ä½æããSQLãsqliteã«æµãã¾ã sqlite3 ${HOME}/.mozilla/firefox/default/places.sqlite < ${sqlfile} rm ${sqlfile} fi # Firefoxãèµ·å firefox
([email protected]ã«ã¦åä½ç¢ºèª)
ä¿®æ£ : shellããfirefoxãèµ·åããããã«å¤æ´
(追è¨)試ç¨
Firefoxããã®ã·ã§ã«ãå©ãã¦å®è¡ããããã«ãã¾ãã(èµ·åã«é
ããªã£ããããªæ°ããã¾ã...)ã
SQLiteã®DELETEã¯WHERE EXISTSãINNER JOINã使ããªã
SQLiteã¯DELETEæã«WHERE EXISTSãINNER JOINãå©ç¨ã§ããªãããã§ãå¥ãã¼ãã«ã®SELECTçµæãåç §ãã¦DELETEããå ´åã¯WHERE id IN (SELECT id FROM ...)ã®ããã«ãã¦ãããå¿ è¦ãããã¾ãã(ã¤ã¾ã¥ããï¼ï¼)
追伸
ååã®ã¨ã³ããªã¼ããå®ã«2年以ä¸çµã£ã¦ãã¾ãã...ã
2å¹´åã¯Wedãã¶ã¤ãã¼æ¡ç¨ã®ãªãã¡ãã£ã¦ããã°ã©ãã¼ã ã£ãã®ã§ããã2010å¹´2æããæ£å¼ã«ããã°ã©ãã¼ã¨ãã¦æ¡ç¨ããPHPãã¡ã¤ã³ã«éçºã®ãä»äºããã¦ãã¾ã(ããªãã¡ãã£ã¦ãããè±ãããã¯å¥ã®ã話)ã