spyglass-search / spyglass

A personal search engine: Create a searchable library from your personal documents, interests, and more!
https://docs.spyglass.fyi
GNU Affero General Public License v3.0
2.51k stars 57 forks source link

Can't use custom lenses #462

Closed ridai260 closed 1 year ago

ridai260 commented 1 year ago

Windows 11 22H2.

  1. Installed latest version.
  2. Went to https://docs.spyglass.fyi/usage/lenses/build.html.
  3. Copied the recipe code into a new file called recipe.rom in the lens folder that opens via "Lens folder".
  4. Saved, clicked "Update", nothing new. Restarted the app, still nothing new in the lenses list. The app itself is not indexing or doing anything at all at this time.
  5. If I use one of the preset ones from the website it works OK and I can see it dropped into that lens folder.

Am I doing something wrong?

Esc also doesn't close it, only minimizes it so it sits on my task bar (raise another issue for this one perhaps?).

a5huynh commented 1 year ago

Hey @ridai260, thanks for opening this issue. Just out of curiosity did you copy the recipe one verbatim? There is some comments in there that would break if actually used.

Also, if you don't mind. Could you check the logs after startup? The app should output some errors if it's unable to load the lens.

movanet commented 1 year ago

My RON files also doesn't work if it gets too long...

I've tried using $ but it doesn't work, so I tried limiting depth. It works, but only if it consist of a few lines.

This one below doesn't work:

( author: "spyglass-search", name: "read", label: "read", description: Some(r#"read"#), categories: ["knowledge"], domains: [], is_enabled: true, urls: [ "https://blog.readwise.io/p/bf87944f-b0fe-4f08-a461-f75ab8aded6a/" "https://blog.readwise.io/p/f8c0f71c-fe5f-4025-af57-f9f65c53fed7/" "https://github.com/TryGhost/Dawn/" "https://github.com/continuum-llms/chatgpt-memory/" "https://www.graphmaker.ai/" "https://dev.codedesign.app/a/" "https://dev.codedesign.app/ai/" "https://theconversation.com/torrents-of-antarctic-meltwater-are-slowing-the-currents-that-drive-our-vital-ocean-overturning-and-threaten-its-collapse-202108/" "https://spacedesk.net/" "https://neo4j.com/developer-blog/chatgpt-4-knowledge-graph-from-video-transcripts/" "https://github.com/Mocca101/obsidian-plugin-groups/" "https://github.com/Ai-Austin/Bing-GPT-Voice-Assistant/" "https://store.minisforum.com/products/x500/" "https://github.com/lgrammel/gptagent.js/" ], version: "1", rules: [ LimitURLDepth("https://blog.readwise.io/p/bf87944f-b0fe-4f08-a461-f75ab8aded6a/", 0), LimitURLDepth("https://blog.readwise.io/p/f8c0f71c-fe5f-4025-af57-f9f65c53fed7/", 0), LimitURLDepth("https://github.com/TryGhost/Dawn/", 0), LimitURLDepth("https://github.com/continuum-llms/chatgpt-memory/", 0), LimitURLDepth("https://www.graphmaker.ai/", 0), LimitURLDepth("https://dev.codedesign.app/a/", 0) LimitURLDepth("https://blog.readwise.io/p/bf87944f-b0fe-4f08-a461-f75ab8aded6a/", 0) LimitURLDepth("https://blog.readwise.io/p/f8c0f71c-fe5f-4025-af57-f9f65c53fed7/", 0) LimitURLDepth("https://github.com/TryGhost/Dawn/", 0) LimitURLDepth("https://github.com/continuum-llms/chatgpt-memory/", 0) LimitURLDepth("https://www.graphmaker.ai/", 0) LimitURLDepth("https://dev.codedesign.app/a/", 0) LimitURLDepth("https://dev.codedesign.app/ai/", 0) LimitURLDepth("https://theconversation.com/torrents-of-antarctic-meltwater-are-slowing-the-currents-that-drive-our-vital-ocean-overturning-and-threaten-its-collapse-202108/", 0) LimitURLDepth("https://spacedesk.net/", 0) LimitURLDepth("https://neo4j.com/developer-blog/chatgpt-4-knowledge-graph-from-video-transcripts/", 0) LimitURLDepth("https://github.com/Mocca101/obsidian-plugin-groups/", 0) LimitURLDepth("https://github.com/Ai-Austin/Bing-GPT-Voice-Assistant/", 0) LimitURLDepth("https://store.minisforum.com/products/x500/", 0) LimitURLDepth("https://github.com/lgrammel/gptagent.js/", 0) ], )

a5huynh commented 1 year ago

@movanet Just to confirm what you're doing, you only want to add each individual URL correct?

And maybe it's a formatting issue but are those urls separate by commas? For example, I reformatted your lens a bit and it seems to be working okay without the LimitURLDepth rules:

(
    author: "spyglass-search",
    name: "read",
    label: "read",
    description: Some(r#"read"#),
    categories: ["knowledge"],
    domains: [],
    is_enabled: true,
    urls: [
        "https://blog.readwise.io/p/bf87944f-b0fe-4f08-a461-f75ab8aded6a/$",
        "https://blog.readwise.io/p/f8c0f71c-fe5f-4025-af57-f9f65c53fed7/$",
        "https://github.com/TryGhost/Dawn/$",
        "https://github.com/continuum-llms/chatgpt-memory/$",
        "https://www.graphmaker.ai/$",
        "https://dev.codedesign.app/a/$",
        "https://dev.codedesign.app/ai/$",
        "https://theconversation.com/torrents-of-antarctic-meltwater-are-slowing-the-currents-that-drive-our-vital-ocean-overturning-and-threaten-its-collapse-202108/$",
        "https://spacedesk.net/$",
        "https://neo4j.com/developer-blog/chatgpt-4-knowledge-graph-from-video-transcripts/$",
        "https://github.com/Mocca101/obsidian-plugin-groups/$",
        "https://github.com/Ai-Austin/Bing-GPT-Voice-Assistant/$",
        "https://store.minisforum.com/products/x500/$",
        "https://github.com/lgrammel/gptagent.js/$",
    ],
    version: "1",
    rules: []
)
movanet commented 1 year ago

Thanks! I can confirm that this works! I have added many other links to the ron file. I was exporting my pocket list. It would be quite handy if we could use pocket API to automatically crawl them. Also, also it would good if there is an interface where we can insert links and specify crawldepth in addition to the lenses.

Great stuff! I am happy now that I can index lots of things :)