Automatically importing firefox bookmarks similar to how Zotero Connector would create them manually

Hey,

since I just started using Zotero, I was wondering if there exists a way to import Firefox bookmarks to Zotero, similar to how the connector would create snapshots and retrieve them?

I already know about the possibility to export the bookmarks from Firefox as HTML and import those into Zotero, as written here: https://forums.zotero.org/discussion/73765/import-firefox-bookmarks

When importing via the exported HTML, I simply get a list of Link-References.
The above approach isn't useful to me, since I'd like to import the bookmarks similar to how the Zotero connector adds items, which grabs much more information due to its functionality.

I wouldn't be shy to program something myself if there isn't any existing solution out there. However, I'm new to Zotero and the terminology of the functionality in general, which makes formulating what I want a bit more difficult.

To put it into simple terms:
Currently I would need to go through each of my bookmarked links, click the Zotero connector, save the page snapshot and tag it appropriately.
I have about ~1400 bookmarks, so I'm already thinking that a programmatic approach might be better time spent.
Additionally, Zotero connector handles certain pages in a special way, such as "Stack Exchange" sites, where it recognizes it as forum posts.
That's all very nice, but I'd rather have it do that automatically or programmatically for all of my existing bookmarks.

So, here's a few questions:
- What documentation or other resources should I check out to inform myself about this?
- Is there anything similar or existing out there?
(I already saw the Zotero connector on github, but I wouldn't know where to begin, what to look for)
- Is this even possible to do, since I'm basically "WebScraping" my saved bookmarks in the fashion of Zotero connector?

Any help is greatly appreciated.

Kind regards,

HackXIt
  • You can read through this thread for the reasons we don't support this and some example code if you really want to do it. (It's less of a problem if none of your URLs are gated.)
  • So, to summerize:

    - Zotero is meant to be used manually with the Zotero Connector, due to it using cookie-states and many things from the browser
    - If I want to import my existing bookmarks similarly (but not identical) to how the Zotero Connector does it, I'd need a newline separated list of URLs and execute the code from your linked thread

    Did I miss something?
  • (I mean, "used manually with the Zotero Connector" specifically for the case of adding things by URL. There are lots of other ways to add things to Zotero. But this is the reason why Add Item by Identifier doesn't support URLs.)
  • edited February 22, 2023
    I ran your code, and it works sufficiently for my purpose, but there's a problem in regard to certain sites like stackoverflow.

    In the Zotero Connector, I can select if I want question and/or answers to be referenced with the snapshot.

    I do not know the Zotero internals enough to know how I can do this selection in code?

    I assume I'd have to configure the translator after `translate.setTranslator(translators[0]` somehow, but looking into the translator of Stack Exchange, did not really help me.
    Furthermore, I only found the function which returns the results inside the translator, but I didn't find where in the Zotero code the selection takes place, to see what kind of functions I could call.

    If you could help me with that or point me to relevant sources, I'd be grateful.

    ---

    I don't want every answer of a stackOverflow URL referenced, it would be sufficient to only reference the question, which is always the first entry.
    Otherwise, the execution takes... forever, because it has to reference waaay more things with the snapshot.
  • The select code is here: https://github.com/zotero/translators/blob/master/Stack Exchange.js#L69

    but I'm doubtful this can be run from the javascript api (but you can certainly try)
  • edited March 12, 2023
    Hello, any gist, snippet or code ready to use out of this discussion?

    I just encountered the need for adding around 10 to 15 urls that I would like to import in my library.

    A brief description of my case: I was doing a little search on a given topic and wanted a quick way to filter out pages that were relevant reading the tittle but irrelevant after a second closer read. I used the collections feature from microsoft edge to make very short comments on each url. At the end I wanted to import the remaining article I kept as relevant for the scope of my search.

    I thought to use zoterobib.org but this is not possible.
    And also from an opml file, without success.
  • edited March 12, 2023
    @alflamingo: Open them in tabs and click the save button 10–15 times? Should take 30 seconds.
  • The relevant code snippet is here, as noted above: https://forums.zotero.org/discussion/comment/337665/#Comment_337665
    but I agree with dstillman: this is relevant/useful if you have 50-100+ URLs. For 10-15, you're going to be faster just using your browser.
  • Fair enough thank you very much for these two recommendations,
    save button will do the job!
Sign In or Register to comment.