Initial Version of an Auto-Generated Bookmarks Tool

It's Friday hack day. As I mentioned earlier in the week, I've been working on a Java application that takes a "bookmarks.xml" file describing a set of topics that you potentially want to automatically generate the best bookmarks for. This post is just to say that it's working great.

I will now try to jump through whatever hoops are needed to share the source code so others can use it and hopefully help to further improve it.

So here's how it works in more details. The initial XML file has entries of the form:

    <?xml version="1.0"?>
    <!-- Sample set of auto-generated bookmarks -->
    <bookmarks>

      <topic
        name="Perl"
        >

        <entry
          label="API"
          query="Perl language operators functions"
        />
        <entry
          label="FAQ"
          query="Perl language FAQ"
        />
        <entry
          label="Tutorial"
          query="Perl language tutorial"
        />
        <entry
          label="Manual Pages"
          query="Perl language manual pages"
        />
        <entry
          label="HOWTOs"
          query="Perl language HOWTOs"
        />
        <entry
          label="Modules"
          query="Perl language interfaces modules"
        />

      </topic>
    </bookmarks>

Over time, I'll probably add more tags to this file to help delineate different subjects, but for now my sample bookmarks.xml file contains the entries above for a variety of different programming languages that I'm interested in (C, C++, Java, JavaScript, Korn Shell, Lisp, Perl, Python, Objective-C, Ruby, Smalltalk and Tcl/Tk).

When the Java app reads in the bookmarks file, it creates a row of labeled checkboxes, one for each entry in the topic. Each row is a JPanel which gets added to a scrollable pane. The user checks the ones that they would like to generate bookmarks for. When you are ready, you click on a "Generate" button, and the application then makes Google search API calls to generate the best URL for each search. It then writes the results out as an HTML page.

Here's what it generated when I checked all bookmarks (HTML web page headers and footers removed):

There are currently three command line options you can supply to the tool:

  • the name of the bookmarks.xml file to read from. If this is not supplied, it currently reads from System.in.
  • the name of the HTML web page of bookmarks to generate. If this is not supplied, it currently writes to System.out.
  • the Google search key to use. Each user of this tool will need to supply their own key that they've obtained from Google. See my previous post for more details.

There's still lots to do. As you'll see from some of the URL's automatically generated above, the search query terms need to be refined to hone in on the best and/or correct web pages to return. As it stands, it does a surprisingly good job with very simple search terms. There are some bad ones like this for "Smalltalk HOWTOs" though. Something where others can help is to generate unique search query strings that best capture the web page wanted.

I also want to improve the GUI a bit, add in a menu-bar, and GUI ways to set the input/output files and the search key. Plus some easy way to automatically check all the checkboxes for one topic, and so on.

Hopefully I'll find some time to continue this next week.

[]

[]

Comments:

Post a Comment:
Comments are closed for this entry.
About

user12607856

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today