channel4services » introduction  · rss  · 2ch portal  · kareha scripts

Kareha Scripts & Extensions

The scripts here are provided so that other users of Kareha can extend or modify their installations.

Mobile Services

If you wish to view Channel4 with your phone, point your phone's browser towards http://4-ch.net/mobile.

All the boards on Channel4, minus the archives have a mobile reader, which greatly cuts down on the needed bandwidth to view the boards, making it quicker and more suitable for people with handheld devices. It currently only works with phones that support the Mobile XHTML profile, so older WML and possibly some Japanese CHTML-based phones may have difficulty viewing the pages. Users of Opera Mini and Opera's Nintendo DS client don't have any known problems, so far.

If you have any problems with the mobile services within Channel4, let us known through the Handheld support thread.

Source Code

View/Download the source

To install it, just put it in the same folder as kareha.pl, give it execution permissions (chmod 755 mobile.pl) and you're done. Optionally, if your board is not in English or you wish to localise it further, there is two constants you can put into your templates.pl:

use constant S_MO_TRUNC => '<a href="%s">Entire post...</a>';
use constant S_LAST10   => 'Last 10 posts';

Just modify the strings to suit your language, and insert them in.



Archiving Script

A known trait of Kareha is that as more threads are created, its performance decreases. If boards are exceedingly busy, this can be solved by configuring Kareha to only store a limit amount of threads. However to boards that are small and contain threads and posts worth archiving for the future, offloading these threads is the best idea. This script can collect any combination of threads that have been filled, closed, or are older than a certain amount of days and move them to another location.

Source Code

View/Download the source

Put the script in the same folder as your Kareha install, edit the configuration options, give it execution permissions (chmod 755 archive.pl) and you can either run it at scheduled intervals with crontab, or only on demand. This script requires to be run from a terminal or SSH connection, and will intentionally die to prevent mis-use if run via a web browser.


counter.pl

TBD


Other scripts

Board duplication, others. TBD