WebConnectPack addons/plugins

A bug was recently filed highlighting the fact that many of the U.S. Web Connect searches were no longer valid.

0011890: [Web Connect Pack] Internet links have changed and become invalid

In exploring the links, one was a link searching a specific family tree hosted on Geneanet which would not be appropriate for a general user audience. There is already a search option to the entire Geneanet site

In exploring potential new links to be included, a discussion was started on adding searches to a general site like FamilySearch but tailoring the search to a specific database within FamilySearch.

I am an active user of the Web Connect plugin and had created some searches specific to my research needs. Searches that would have limited appeal so not appropriate to being coded into the USWebConnectPack. After the third time my copy of the UsWebConnectPack was updated, erasing my specific searches, I thought to create MYWebConnectPack.

After copying the USWebConnectPack folder and renaming the folder and its files to MYWebPack.it was a simple process to edit the lines of MYWebPack.gpr.py. Change the lines to

id="MY Web Connect Pack",
name=_("MY Web Connect Pack"),

fname="MYWebPack.py",

Then it is only a matter of replacing the menu of existing WEBSITES in MYWebPack.py with my own.

I offer this tip up to @emyoulation and other users that need a way to store their own unique Web Connect searches.

This trick cannot be made into a standard addon/plugin. After all, you do not want an update erasing your files. So it is a tweak that you must do for yourself. Fortunately, no country uses MY as their country code.

4 Likes

If you want to get started customizing Gramps, creating a custom WebConnect query is probably the next step after learning to design custom filters. It only takes a single line of code to add a new Web connection.

There’s a lot more coding involved in formatting Reports or defining Books of Reports. The steps beyond this are modifying Report templates, writing filter Rules, then writing new Reports & Gramplets.

The support files for this gramplet are installed in the User Directory for your OS.

These add-ons call the LibWebConnect library is used for parsing the Query strings and constructing a URL to be called. It can be helpful to inspect this library code to understand what can be parsed and what parameters that can be substituted.

For Windows, the local path is:
%AppData%\gramps\libwebconnect\libwebconnect.py

For Windows, the files to be updated are:
%AppData%\gramps\USWebConnectPack\USWebPack.py

DEFRNLSLUKUS

1 Like

(This posting will evolve to correct misinformation.)

The substitution strings are:

  1. surname : surname (composite, if multiple surnames)
  2. given : 1st word of the “Given:” field
  3. middle : (disabled by default, change parsing in libwebconnect.ini )
  4. birth : year only
  5. death : year only

To find a URL sample to convert into a substitution-based WebConnect query, go to a website which has a form where you can enter some sample data using only the fields above. When you submit the form, copy the generated Query and replace the sample data with the substitution strings. When you have a converted Query, swap it into your My Web Connect Pack and test it.

As an example, I logged into FamilySearch and drilled down to their US Social Security Death Index. Then punch in placeholder data and 'Search' to generate the following sample query.

https://www.familysearch.org/search/record/results?q.givenName=given%20middle&q.surname=surname&q.birthLikePlace=ancestorHometown&q.birthLikeDate.from=1899&q.birthLikeDate.to=1901&q.deathLikePlace=ancestorTerminus&q.deathLikeDate.from=1999&q.deathLikeDate.to=2001&f.collectionId=1202535&m.defaultFacets=on&m.queryRequireDefault=on&m.facetNestCollectionInCategory=on&count=100&offset=0

which becomes

https://www.familysearch.org/search/record/results?q.givenName=%(given)s%20%(middle)s&q.surname=surname&q.birthLikeDate.from=%(birth)s&q.birthLikeDate.to=%(birth)s&q.deathLikeDate.from=%(death)s&q.deathLikeDate.to=%(death)s&f.collectionId=1202535&m.defaultFacets=on&m.queryRequireDefault=on&m.facetNestCollectionInCategory=on&count=100&offset=0

The sample WebPack line is:
["Person", "Find-A-Grave", _("Find A Grave (±1 year)"), "http://www.findagrave.com/memorial/search?firstname=%(given)s&middlename=%(middle)s&lastname=%(surname)s&birthyear=%(birth)s&birthyearfilter=1&deathyear=%(death)s&deathyearfilter=1&orderby=b"],

which becomes
["Person", "FamilySearch (SSDI)", _("FamilySearch (SSDI)"), "https://www.familysearch.org/search/record/results?q.givenName=%(given)s%20%(middle)s&q.surname=surname&q.birthLikeDate.from=%(birth)s&q.birthLikeDate.to=%(birth)s&q.deathLikeDate.from=%(death)s&q.deathLikeDate.to=%(death)s&f.collectionId=1202535&m.defaultFacets=on&m.queryRequireDefault=on&m.facetNestCollectionInCategory=on&count=100&offset=0"],

2 Likes

The default is that the Given Name is parsed with the first name in the field becoming the only given name. The rest of the given name is discarded or removed.

There are two other options, leave alone, and separate.

Leave alone sends the full Gramps Given Name to the substitution string given.

Separate creates a given substitution strings as well as a middle substitution string.

To override the default, edit the /plugins/libwebconnect.ini file.

The configuration line is by default

;;middle-name='remove'

make it

middle-name='separate'

or

middle-name='leave alone'

for the desired options.

1 Like

I like the MYWebpack.py concept to protect your custom web searches from being overwritten by Plugin updates.

However, they are still susceptible to being wiped out accidentally via the Plugin Manager.

If you forgot about your MYWebpack, you might inadvertently Uninstall or Hide it via the Plugin Manager. Then, your customizations would be simply gone.

For my customizations (Rules, webconnections, preferences, et cetera) to Gramps, I’ve taken to making a Media object for each one. This allows me to put the path in the Media definition and to paste the source code into a Note for that Media object.

This gets backed up with my Tree. So, even if the customization are lost, I can reconstitute them easily.

Backup Backup Backup

I keep a copy outside of the plugins directory along side a copy of any other file I have tweaked And these get backed up on a regular basis to an external drive.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.