Frontends for:
* Youtube


Status
------

Actively maintained:
* Youtube

Unmaintained and archived:
* Duckduckgo
* Reddit
* Twitch (not working anymore, it also now required 2FA and OAUTH).


Dependencies
------------

* C compiler.
* LibreSSL + libtls.
* make


Build
-----

To compile a specific front-end:

$ make youtube

or all using:

$ make
# make install


Features
--------

- Search videos.
- Doesn't use JavaScript.
- Doesn't use (tracking) cookies.
- CSS is optional.
- Multiple interfaces available: CGI web, CLI, gopher (gph), this is a
  work-in-progress.
- Shows an Atom feed of the user/channel.
- Doesn't use or require the Google API.
- CGI interface works nice in most browsers, including text-based ones.
  On OpenBSD it runs "sandboxed" and it can be compiled as a static-linked
  binary with pledge(2), unveil(2) in a chroot.


Cons/caveats
------------

- Order by upload date is incorrect (same as on Youtube).
- Some Youtube features are not supported.
- Uses scraping so might break at any point.


Install HTTP CGI
----------------

Nginx + slowcgi example:

	location /idiotbox/css/.* {
		root /home/www/domains/www.codemadness.org/htdocs/idiotbox/css;
	}

	location ~ ^/idiotbox(/|/\?.*)$ {
		include /etc/nginx/fastcgi_params;
		fastcgi_pass  unix:/run/slowcgi.sock;
		fastcgi_param SCRIPT_FILENAME  /cgi-bin/idiotbox;
		fastcgi_param SCRIPT_NAME  /cgi-bin/idiotbox;
		fastcgi_param REQUEST_URI  /cgi-bin/idiotbox;
        }

httpd + slowcgi example:

	location "/idiotbox" {
		root "/cgi-bin/idiotbox.cgi"
		fastcgi
	}


When using a chroot make sure to copy /etc/resolv.conf and /etc/ssl/cert.pem.

To test from the command-line you can do:

	QUERY_STRING="q=funny+cat+video" ./main | sed 1,2d | lynx -stdin
