Omnimaga
General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: Juju on March 24, 2013, 07:40:36 pm
-
Well, this is whatever I worked on since yesterday evening, it's a command-line OmnomIRC client made in php using ncurses and readline, so it kinda looks like irssi and it supports input line edition and stuff like that (just like in irssi) and userlist. So yeah, pretty useful if you like irssi and you don't feel like firing up graphics. Oh, and don't forget editing the stuff at the beginning of file.
Source: https://raw.github.com/juju2143/nOmnomIRC/master/nomnomirc.php
TODO: Colors!
-
sorunome-laptop% php ./nomnomirc.php
PHP Fatal error: Call to undefined function ncurses_init() in /home/sorunome/Desktop/nomnomirc.php on line 212
And OmnomIRC works by now over elinks, so you don't need to fire up a GUI anyways :P
If you want to juju fork the project on github and do more stuff with it :)
EDIT: yeah, i have ncurses installed, it still doesn't work
-
You should apt-get install php5-ncurses, then uncomment both extension=sqlite3.so (if you use Chrome or Firefox) and extension=ncurses.so in php.ini.
And yeah well, this one should be more convenient as it uses ncurses and it has a irssi look-and-feel.
Plus if you read the code, it's a pretty perfect example on how to use the OmnomIRC API, ncurses and readline.
-
I use archlinux and that is not in the official repo or in the aur
-
pacman -S php-ncurses, then.
EDIT: Wait got it wrong, was confused.
sudo pacman -S php-pear php-sqlite
sudo pecl install ncurses
-
Nope, doesn't exist :(
-
Now it works.
Also Sorunome wanted it in GitHub, there we go: https://github.com/juju2143/nOmnomIRC
-
Update! Colors! They work!
EDIT: They work even more!
-
Nice! How about other text decorations?
-
Nice! How about other text decorations?
They also work! 16 colors (or 8, dunno, it's hard to tell), bold, underline and reverse, they all work!
-
also reversing reversed? (that doesn't work on omnomirc O.O)
(and italic? :P)
-
Yes. No italics though.
-
then add italic :P it is \x1d
-
How you can italics in a terminal?
-
Well, I get that :
PHP Fatal error: Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file' in /home/danelkouby/nomnomirc.php:330
Stack trace:
#0 /home/danelkouby/nomnomirc.php(330): SQLite3->__construct('/home/danelkoub...')
#1 {main}
thrown in /home/danelkouby/nomnomirc.php on line 330
I installed all the stuff correctly so I don't know what's wrong. :/
-
It can't open the database where the cookies are stored. Which browser do you use? Did you tweaked the first lines or so of the php file?
-
I just added #! /usr/bin/php to the top (obvious reason) and run it with ./nomnomirc.php.
I don't know how my browser could be related to this but I use Chromium from the Arch official repos.
-
It uses Chromium's data to login to Omnimaga. So if you're logged in to Omni in Chromium and you gave the right path to the cookies database, you might be okay.
-
Oh well I did not edit anything else than that first line. :/ I guess that might be the issue.
-
:P
I just changed the cookie path to the chromium one (changed google-chrome to chromium) and left the browser set as Chrome since both are nearly identical.
-
Looks like you have to set the timezone in the script.
http://us2.php.net/manual/en/function.date-default-timezone-set.php <-- Function you need to call at the start of the script.
http://us2.php.net/manual/en/timezones.php <-- List of supported timezones to use.
-
Actually you might want to set your timezone in php.ini. http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
-
I just updated my php.ini. It works now. :D
Seems to lag quite a bit though.
-
It does yeah. It's not threaded, so it might freeze while it does the http requests. I gave a 1-second timeout though, so it won't freeze for like 60 seconds everytime.
-
I read the topic and assume it's for Nspires because of the n. Then, I get giddy because I assumed php was ported to Nspires.
Right.
Just...this.
I'll go put the fireworks away.
Not really, this is actually quite cool. Might help for those of us who can't use the widget :) Like at my mom's house, the computer there! because it is terrible using Windows Server and Chrome.
-
That might work if you use Nspire Linux, actually, if you compile php for ARM and get Internet access to your calc.
-
Well that's much easier said than done.