Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Closes #517 Display Keyword obtained from breaking up the title of im…
Browse files Browse the repository at this point in the history
…portant bookmarks and from main part of their Url.
  • Loading branch information
grssam committed Jun 8, 2011
1 parent 87f012d commit b82ef5f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions speakWords/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,19 @@ function startup(data) AddonManager.getAddonByID(data.id, function(addon) {
addKeywords(explode(url, /[\/:.?&#=%+]+/).slice(1));
addKeywords(explode(title, /[\s\-\/\u2010-\u202f\"',.:;?!|()]/));
});

//Use bookmarks to discover keywords from their titles or urls
spinQuery(DBConnection, {
names: ["url", "title"],
query: "SELECT *"+
" FROM moz_bookmarks JOIN moz_places "+
" ON moz_bookmarks.fk = moz_places.id "+
" WHERE moz_bookmarks.title NOT null "+
" ORDER BY moz_places.frecency DESC LIMIT 100 ",
}).forEach(function({url, title}) {
allKeywords.push(explode(title, /['":;_\s\-\/\u2010-\u202f\"',.:;?!|()]/));
allKeywords.push(explode(url.split(/[?]+/)[0], /['";\/:.&#=%+_]+/).slice(1));
});

// Add in some typed subdomains/domains as potential keywords
function addDomains(extraQuery) {
Expand Down

0 comments on commit b82ef5f

Please sign in to comment.