💾 Archived View for gemi.dev › gemini-mailing-list › 000722.gmi captured on 2024-03-21 at 18:01:06. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-12-28)

-=-=-=-=-=-=-

Search forms and server side search scripting?

1. Lars Noodén (lars.nooden (a) gmx.com)

I've looked at the Gemini specification [1] and wonder where I can find
information about receiving search or other input from the client.
Perhaps I am missing something obvious, as I see that there are a
growing number of interesting, searchable capsules [2] but have not yet
seen how to do that.  My goal is to implement a local search function
for a capsule being built.

So I have two questions,

1) What markup should a gemini page contain to trigger an input dialog,
and where may I see some sample code or pseudo code for the server-side?
 If anyone has any sample- psuedo code to share, that would be wonderful.

2) Which servers are light yet can still handle referrals to scripts, or
is that best handled by a separate package and let the server deal with
static pages only?

/Lars

[1] https://gemini.circumlunar.space/docs/specification.html

[2] e.g. gemini://gemini.omarpolo.com/cgi/gempkg/search

Link to individual message.

2. Remco (me (a) rwv.io)

2021/02/18 09:07, Lars Nood?n:

> I've looked at the Gemini specification [1] and wonder where I can find
> information about receiving search or other input from the client.
> Perhaps I am missing something obvious, as I see that there are a
> growing number of interesting, searchable capsules [2] but have not yet
> seen how to do that.  My goal is to implement a local search function
> for a capsule being built.
>
> So I have two questions,
>
> 1) What markup should a gemini page contain to trigger an input dialog,
> and where may I see some sample code or pseudo code for the server-side?
>  If anyone has any sample- psuedo code to share, that would be
> wonderful.

Here's an example of a very basic CGI script written in Ruby:

  gemini://rwv.io/src/search

It triggers a "10" response when there's no query set, otherwise it
returns a "20" response with links to all the files matching the query.
In this case it simple greps through the gemini directory.

Note, it doesn't do query string decoding so, depending on the server,
you might have to do some for "special" characters.

> 2) Which servers are light yet can still handle referrals to scripts, or
> is that best handled by a separate package and let the server deal with
> static pages only?

Any light server supporting CGI should be fine.

Cheers,
Remco

Link to individual message.

3. Lars Noodén (lars.nooden (a) gmx.com)

On 2/18/21 10:21 AM, Remco wrote:
> 2021/02/18 09:07, Lars Nood?n:
>> ...
>
> Here's an example of a very basic CGI script written in Ruby:
>
>   gemini://rwv.io/src/search
>
> It triggers a "10" response when there's no query set, otherwise it
> returns a "20" response with links to all the files matching the query.
> In this case it simple greps through the gemini directory.
>
> Note, it doesn't do query string decoding so, depending on the server,
> you might have to do some for "special" characters.
> ...

Thanks!  I appreciate it.

Link to individual message.

---

Previous Thread: Capsule Update: Fruit Consumption Per Capita(Part 1)

Next Thread: [ANN] Planet m68k Gemini capsule