CodeWalrus

Development => Web => Topic started by: _iPhoenix_ on November 12, 2017, 11:37:38 pm

Title: UniChat!
Post by: _iPhoenix_ on November 12, 2017, 11:37:38 pm
Site is here! (https://legend-of-iphoenix.github.io/UniChat/)
Today, (As I am posting this) I created a free, simple, and open solution to a problem exactly none of us have. I created what is essentially an IRC chatroom, but crappier!


Introducing UniChat (https://legend-of-iphoenix.github.io/UniChat/), which is a bare-bones, embarrassingly simple chatroom!


Utilizing Google's powerful Firebase platform, it is a place where you can communicate with the other users, which has peaked at 5 (yay, much many users)!


Not only is it a great messaging tool, but I am using it to create a bounty of anonymized, secure data that my machine-learning algorithms can learn human behaviour from!


It is also in active development, with new features arriving every day! (keep in mind that I came up with the idea ~8 hours ago as I am posting this)


Planned features: (starting at -2 because I was too lazy to go back and change the numbers as I came up with new ideas)
-2) OMFG CSS
-1) Username-from-cookie detection (so you don't have to keep typing the same username every time you reload the page)
0) Message submission with pressing the Enter key.
1) highlights and @mentioning
2) URL detection and creation
3) pm's and /me
4) private chatrooms (maybe)
5) ???


Current features:
1) Working message storage.
2) Usernames
3) Automagic pseudorandom default username creator thing
4) Unlimited message length (intentional abuse = limited message length, and/or ban from service. Potentially worse punishments will be added, if I can come up with new punishments :/)
5) Amazing, CSS-less layout.


Please do not use severely profane words (i.e. worse than ccrraapp) on UniChat.


I am also looking for more adjectives and nouns for the automagic pseudorandom default username creator thing (you can type lists of them into the service, I can check the logs if you want)
Title: Re: UniChat!
Post by: xlibman on November 13, 2017, 01:56:58 pm
By CSS, do you mean each message will have custom CSS? :P Also I hope HTML isn't parsed ,in messages (eg embedded rickrolls)
Title: Re: UniChat!
Post by: _iPhoenix_ on November 14, 2017, 12:43:36 am
<double post because of huge update>

I added
Code: [Select]
/pm <user> <message>, which basically sends them a message that only they can see.

Code: [Select]
/me <action> was also added by popular request, and I quite like it.

Certain bugs were squashed, more CSS was added, and I rounded out some of the database glitches. (ooh they were nasty, thank goodness this was when nobody was online)

UniAdmins (currently only me) can also do /you, which is basically /.me but acts as if someone else was using it. It's hilarious.

Your username is remembered when the page loads, and you can press enter to submit messages!!!

More suggestions are welcomed. You can use
Code: [Select]
/pm _iPhoenix_ <suggestion> on there, or just post 'em up here! Thanks!

(And all characters are escaped, so any html is rendered as text, without being executed. Same goes for JS)
Title: Re: UniChat!
Post by: Ranman on November 14, 2017, 01:01:02 am
 :thumbsup: :thumbsup: :thumbsup:

Simply awesome!!
Title: Re: UniChat!
Post by: Unicorn on November 14, 2017, 04:18:50 am
It looks pretty nice, though your container things could use some padding, and it appears you have to click the submit button twice? (give that some css as well ;) )
Title: Re: UniChat!
Post by: xlibman on November 14, 2017, 04:45:54 am
Will the chat remain permanently logged?
Title: Re: UniChat!
Post by: _iPhoenix_ on November 14, 2017, 11:35:38 am
It looks pretty nice, though your container things could use some padding, and it appears you have to click the submit button twice? (give that some css as well ;) )

On mobile, you have to click once to see the non-existent tooltip, then again to click the button. IIRC this is an IOS thing.

Will the chat remain permanently logged?

Nope! Users can only see the last 10 messages! (Reload the page)

In the DB I have semi-permanent records, but I anonymize them, download them, and delete their online versions to save space.

UniChat users have typed nearly 3 megabytes of just text, which is quite a lot, if you think about it.
Title: Re: UniChat!
Post by: Unicorn on November 14, 2017, 04:40:55 pm
Check this out:
(https://usercontent.irccloud-cdn.com/file/9MWN7fYd/GIF.gif)

(You can't see the cursor, but I'm clicking on the button)
Title: Re: UniChat!
Post by: _iPhoenix_ on November 14, 2017, 08:06:34 pm
Check this out:
(https://usercontent.irccloud-cdn.com/file/9MWN7fYd/GIF.gif)

(You can't see the cursor, but I'm clicking on the button)

I’ll look in to that ;)
Title: Re: UniChat!
Post by: _iPhoenix_ on November 15, 2017, 01:04:40 am
Chat rooms are a thing!

Currently we have 3, but, I can add new ones with literally one click.

Post your SFW ideas in the “Meta” chatroom!
Title: Re: UniChat!
Post by: Ranman on November 16, 2017, 08:37:42 am
Check this out:
(https://usercontent.irccloud-cdn.com/file/9MWN7fYd/GIF.gif)

(You can't see the cursor, but I'm clicking on the button)

I’ll look in to that ;)

Don't say "hellop".  Maybe it is posting it blindly.... followed by some censorship algorithm that detects "hell" and removes the post.
Title: Re: UniChat!
Post by: _iPhoenix_ on November 17, 2017, 12:30:10 am
Check this out:
(https://usercontent.irccloud-cdn.com/file/9MWN7fYd/GIF.gif)

(You can't see the cursor, but I'm clicking on the button)

I’ll look in to that ;)

Don't say "hellop".  Maybe it is posting it blindly.... followed by some censorship algorithm that detects "hell" and removes the post.

psst... there are no censorship algorithms, besides me looking through the DB and banning users who break rules :P




GREAT NEWS!

The UniChat dev team (*cough* mostly me, besides like 8 lines of code *cough*) has been hard at work implementing tags, highlights, new CSS features, and more!

You can optionally tag your messages with one of the pre-generated (you can suggest more) tags, and, even better, sort the flood of new messages (at least, I hope it will be a flood), with the filter tags!

You can have more than one tag per message, and you can filter more than one tag!

PM's, however, bypass this, and you will see them no matter how you are filtering!

You are highlighted if someone says your name, and you are able to see your message. (if you are highlighted, and you have a filter that does not match their message, then their highlight will not be shown)

Additionally, if you are PM'd, you are also highlighted.

Unfortunately, I haven't implemented any kind of alert (it's really easy, it will take me like 20 seconds), so you will have to check back every few minutes. :/ (I'll probably do some form of audio alert, like a ding, or similar to a SAX highlight, where it changes the title)
 
Every other message is a different color, for ease of use, and hours are in 12-hour format instead of 24-hour format.

There is also a "<user> entered the room" message. The output thingie is also a bit wider.

As per TLM's suggestion, when an invalid message is typed, the input bar's border flashes red.

Of course, I will be implementing SM84CE's ~bot thingies ASAP <3
Title: Re: UniChat!
Post by: xlibman on November 19, 2017, 01:40:41 pm
For alerts, it could be a Chrome or other browser notification maybe.
Title: Re: UniChat!
Post by: _iPhoenix_ on November 19, 2017, 01:44:48 pm
For alerts, it could be a Chrome or other browser notification maybe.

Yeah!
Title: Re: UniChat!
Post by: _iPhoenix_ on November 22, 2017, 02:38:08 am
Development for UniChat has stopped semi-permanently, due to a project that I think is better (and you will too, trust me on this one)

The service, however, will stay up indefinitely! I will still be using it, but no questions about this project will be answered.
Title: Re: UniChat!
Post by: _iPhoenix_ on November 25, 2017, 06:03:59 am
I just pushed a minor update that lets me enter the room silently, so that I don’t fill up the chatroom.

I also fixed a small error where messages sent between 12 am/pm and 1 am/pm would have “00” as the hour in their timestamp.

Edit: Expect small “CSS Tweaks” throughout the day as we “polish the user experience”
Title: Re: UniChat!
Post by: _iPhoenix_ on November 26, 2017, 07:22:54 pm
I added a feature where you can get up to 25 of the most recent PM's that were sent to you.

Only PM's that are sent after this update count!
Title: Re: UniChat!
Post by: _iPhoenix_ on November 27, 2017, 12:36:04 pm
Development for UniChat has stopped semi-permanently, due to a project that I think is better (and you will too, trust me on this one)

The service, however, will stay up indefinitely! I will still be using it, but no questions about this project will be answered.

UniChat is back into active development, due to more free time.
Title: Re: UniChat!
Post by: _iPhoenix_ on November 29, 2017, 12:53:42 am
Although there was not a major feature release today, (The update had/currently has many in-development bugs) I will be adding username protection, (your username is unique to you) and you can pre-reserve your username by going to UniChat and typing any message!

If your username somehow contains any character that is not a letter, a number, or an underscore, please clear the cookies for the UniChat page, or just clear browsing data. You can then enter a username that only contains those characters.
IF YOU DO NOT DO THIS AND YOU USERNAME CONTAINS THE AFOREMENTIONED CHARACTERS, YOUR USERNAME WILL NOT BE RESERVED
Title: Re: UniChat!
Post by: _iPhoenix_ on November 29, 2017, 10:06:31 pm
The site has been turned off due to abuse. We apologize for the inconvenience.

It will be back up, eventually.
Title: Re: UniChat!
Post by: _iPhoenix_ on November 30, 2017, 01:05:46 am
You can use our extremely unstable (but functional) dev build in the meantime.

https://legend-of-iphoenix.github.io/UniChat-dev-unstable/

A full account of what happened is over on Cemetech, I really do not have the energy to cross post right now.
Title: Re: UniChat!
Post by: _iPhoenix_ on November 30, 2017, 11:32:03 am
It seems geekboy, and womp on Cemetech decided to take it into their own hands to spam, so I took down the dev build, too.


Seriously?

As mentioned before, I am sorry to anyone who actually cared.

I also want to note that it appears womp impersonated Pieman and spammed “Pieman did this”.
Title: Re: UniChat!
Post by: _iPhoenix_ on December 01, 2017, 02:06:06 am
Now, all of the moderators/admins on my team can ban (by IP, and username, for any length of time), mute, delete messages, and force users to change their username.

They have been informed that abuse of these privileges is strictly disallowed and that all of their actions are recorded.

Note that we only store IP's in a heavily encrypted form, and they cannot be accessed by anyone besides the person who is banned (so that their local browser can tell they are banned) and the admins (to remove and add bans as necessary)

We also have spam protection, and it's pretty strong. I produced about 40 bots that should represent a bunch of different spamming methods. Each is slightly different, and the service both identifies them and mutes them for a short amount of time. The amount of time increases exponentially each time spam is detected, until they are muted for a day. Once they are muted for a day, they are put on a list for admin checking, and bans will be issued.

Messages are collapsed so that messages that are the same are not sent, but the timestamp changes on the original message to the most recent time and a tag appears that indicates the number of times the message was sent. (e.x. [6x] for a message that was sent six times consecutively).

Messages now have a minimum character limit of 2 characters. (Increased from 1, this shouldn't affect most users too much, the objective is to increase the amount of effort required to spam.)

If you send 8 messages in 15 seconds, then a 15-second cooldown is applied to you. A quick search of the DB showed that this is matched almost all of what I'd consider spam, but only applied once to non-spam messages, and it was because I am a failure at typing and had to correct myself a bunch of times.

We will not release this update until it has been tested under large quantities of strain that it should hopefully never go through under abusive users.

Now, a quick survey. There are other options besides IP tracking, and they are outlined in the form below.  Please tell me what you prefer, as we are split.
(Responses are anonymous, it makes you sign in to Google to limit responses-per-user to one)

Thanks!
Edit: Added link:
https://goo.gl/forms/AC5Ays2AFn9yO7I33
Title: Re: UniChat!
Post by: _iPhoenix_ on December 02, 2017, 03:40:05 pm
A few days ago, on November 27, you would have seen me being rather frustrated about someone deleting the DB.

It turns out, my panic was all over nothing, as it was due to unscheduled downtime from 12:00-12:30 PM PT (Pacific Time), or 3:00-3:30 PM EST (my time, Eastern Standard Time), which is EXACTLY when I do most of my development on UniChat during the school week.

My logs show that I uploaded the backup at 3:34, and when I reloaded the page, it worked.

Well, that's not because of anything I did, it's just because that's when they got their service to work.

(I didn't even know Firebase even HAD a status dashboard)

Source: https://status.firebase.google.com/incident/Realtime%20Database/17094
Title: Re: UniChat!
Post by: _iPhoenix_ on December 02, 2017, 08:10:49 pm
I have created a temporary website, with the sole purpose of generating spam and key mash.

https://legend-of-iphoenix.github.io/spam/

It’s super basic, because I made it in 30 seconds.

Please spam and key mash.

If the message does not disappear from the text area, then it was either too short or too long.

Thanks!
Title: Re: UniChat!
Post by: 123outerme on December 03, 2017, 04:19:54 am
I'd love to see some kind of stats on how well our keymash was; totaling its length, variety of characters, used, and general randomness for points. If you did that, I'd be feeding you so much data you wouldn't ever see the end of it. It's strangely addicting to just pump in random data to a database somewhere, but I think if I knew more about the effects my deluge of data did, I'd be hooked.
Title: Re: UniChat!
Post by: _iPhoenix_ on December 03, 2017, 01:16:24 pm
I'd love to see some kind of stats on how well our keymash was; totaling its length, variety of characters, used, and general randomness for points. If you did that, I'd be feeding you so much data you wouldn't ever see the end of it. It's strangely addicting to just pump in random data to a database somewhere, but I think if I knew more about the effects my deluge of data did, I'd be hooked.

That’s actually an amazing idea, I’ll probably get that working later today.

That’s actually close to what I’m going to do with the data anyways, so I already have my algorithms down, making this SUPER easy.

I have a concert IRL that I have to attend (solo), so I’ll probably get it done this afternoon.
Title: Re: UniChat!
Post by: _iPhoenix_ on December 03, 2017, 06:42:52 pm
Done! Statistics on what you type are now recorded!

If you reload the page, they are stored, too!
(if you clear cookies/browsing data, they are cleared, but it is retrievable, even then)
Title: Re: UniChat!
Post by: _iPhoenix_ on December 04, 2017, 12:40:41 pm
My current goal is around 1-2 million characters, and we are 5% there!

Keep spamming, folks!

PS: I reached 9001 chars

https://legend-of-iphoenix.github.io/spam/ (https://legend-of-iphoenix.github.io/spam/)
Title: Re: UniChat!
Post by: _iPhoenix_ on December 04, 2017, 10:45:56 pm
I changed the bulky character statistics table to a much more friendly HTML5 canvas bar graph.

It is live-updating, and you can see the exact relative quantity of characters!

While developing it, I found it quite interesting to watch :)

(double post because update)
Title: Re: UniChat!
Post by: _iPhoenix_ on December 16, 2017, 09:23:03 pm
This project is not dead!

I’m adding bots; you can suggest witty remarks here! (https://docs.google.com/forms/d/1zEE17LsUSJn_VBkGbwQJwwWjoBAi7fNtryGnOa3-mbM/viewform)

(Action commands, like /pm, will be in a second form, later)

This week has been a very productive week for UniChat: 1.5k-ish additions, 200-something deletions, and more. (We are sorry that we have to keep the service itself under wraps, it's going through some massive changes)

Here's a changelog:
+ Karma and profiles (this is a huge update and I can't put my excitement into words. It isn't done, and needs a TON of polishing, but it's still quite exciting.)
* Restructured how database is stored to make it virtually impossible to spam (All of the spambots we tested can't beat this one, let alone take it down)
+ Added many commands and created a still-unfinished Chatbot API (using the loosest definition of what an API is)
+ Added more ways for the admins and moderators to smite you and laugh in your face. (and a way to report abuse, for the recipients)
* Changed how highlights work.
+ Notifications. (You can toggle between not receiving notifications, only receiving them on highlights, and always receiving them.)
+ Preliminary link detection.
* Internal optimizations.

Here’s the current to-do list:
1) Finish implementing karma. (It’s not going to be live-updating, due to the limitations of GitHub hosting, but it will update every 30 seconds, whenever an admin or moderator has the admin console open)
2) Beautify profile pages, they look like they were made in 30 seconds (they were)
3) Finish link detection.
4) Add buttons for notifications. Currently you have to run a command in the console to toggle them. (Super easy)
5) General UI and UX enhancements.

I’ll probably release a video today or tomorrow showing off the new features.

Or, I can put up a demo, that is, well, broken:
https://legend-of-iphoenix.github.io/UniChatDemo/

I'll try to x-post more, I actually forgot because I was so busy.
Title: Re: UniChat!
Post by: _iPhoenix_ on December 22, 2017, 02:07:58 pm
A lot of changes have happened this week! (I do know it's Friday, I am busy on other projects for the rest of the week. I quite like the idea of weekly update posts, I'll probably keep doing them unless nothing has happened that week.)

(click to show/hide)

* Moved the code handling bots away from the user, due to security. (You could give your self insane quantities of karma really easily. All bots are now controlled from the Admin Console).
* Fixed the bug where messages from bots would appear twice.
* Fixed the bug where return messages from ~karma would sink to the bottom of the page on reload.
* Fixed the bug where /pm's would show up as 'undefined' in the chat log, and you would get notifications from /pm's that you shouldn't see.
+ Bot API (lets you write your own bots) is working, just need to write some docs. (yay fun. I have the first two pages done.)
- Unfortunately, we have to say goodbye to the "get recent pm's" button, because:
+ Added notifications: https://github.com/Legend-of-iPhoenix/UniChatDemo/wiki/Notifications (https://github.com/Legend-of-iPhoenix/UniChatDemo/wiki/Notifications)
+ Added link detection! (I used small snippets of SAX's link detection script, credits are in the readme (https://github.com/Legend-of-iPhoenix/UniChatDemo/blob/master/README.md), and the actual snippet is here (https://github.com/Legend-of-iPhoenix/UniChatDemo/blob/fa9881d669af67255d5f05eb5e18aeedba212b7d/js/main.js#L547-L549))
* Tightened up security.
* Merged karma over from the closed beta, and did a database check to find all <username>++'s and increment karma as necessary.
+ (edit) Added Battlesquid's flame effect to his username in the profile.
+ (edit) Added all kinds of cool commands.
+ (edit) Added semi-functional username linking.
* (edit) Updated the docs (https://github.com/Legend-of-iPhoenix/UniChatDemo/wiki/Command-List) with the new commands.
+ (edit) Added documentation on the bot API, available here:  part 1 (https://github.com/Legend-of-iPhoenix/UniChatDemo/wiki/Bot-API-Tutorial:-The-basics.) and part 2 (https://github.com/Legend-of-iPhoenix/UniChatDemo/wiki/Bot-API-Tutorial:-Simple-Bot-%231)
+ (edit) Work has commenced on a small, UniChat-like bot platform, that is entirely local and lets you test your bots without me going in and making them part of UniChat. (Which may take a while.)

The Closed Beta Testers (Codename: CITY, due to a PM I sent them, titled "Can I Trust You?") were: (in no particular order) TheLastMillennial/TLM, Battlesquid, SM84CE, and xMarminq_.

They all have ethereal, glowy usernames in their UniChat profiles, but I'm giving them the option to have it be whatever they want. I remember that Battlesquid wants (edit: and now has) flames, (as a side note, the flame text currently in jcgter777's signature is from that experiment, I showed Battlesquid a demo picture via SAX, and he wanted a firey version of his username, too!) and other members of the closed beta can submit their choices here. (https://goo.gl/forms/sNdnS9jrX4kco4AW2)

Without their testing, UniChat would be much, much more primitive, and I don't think I would have had the motivation to get this far.

Thanks (https://github.com/Legend-of-iPhoenix/UniChatDemo/blob/7294db0f2ef26799506984c9888a1df4b83c642b/profile/js/main.js#L1-L2).
Title: Re: UniChat!
Post by: _iPhoenix_ on December 22, 2017, 07:28:22 pm
<double triple quadruple? quintuple! sextuple?! septuple?!?! post, big update>

I am SUPER happy to announce that you can finally create your own bots for UniChat, using the UniChat bot API.

You can find the download here (http://tiny.cc/eitmpy), as well as the documentation.

I'm interested in seeing what you guys can create!
Title: Re: UniChat!
Post by: _iPhoenix_ on December 28, 2017, 01:05:10 am
I'm having some issues with my own code that I cannot solve. (And to think I'm the person who is supposed to know these things...)

In the bots API, (relevant file, main.js, is here (https://github.com/Legend-of-iPhoenix/UniChat-botAPI/blob/master/js/main.js)) I'm having some issues where multiple objects (in this case, bots) of the same constructor are sharing properties. (in this case, the name attribute)

In my code, I am creating and initializing bots as per my documentation (http://tiny.cc/hrdppy), but I am initializing two bots, one with the name "iPhoenixBot", and the other with the name "karmaBot". Note that iPhoenixBot is being initialized first, then karmaBot.

The command "~bad" is registered under iPhoenixBot, yet when I execute that command, this happens:

Quote
[07:47:52] _iPhoenix_: ~bad
[07:47:53] [karmaBot]: That's so bad, it's almost impressive!
As you can tell, the username is showing up wrong.

The console tells me this:

Quote
Callback for bot "iPhoenixBot" triggered with message "bad".
Response from "karmaBot" received. //this should be "iPhoenixBot", not "karmaBot"
Callback for bot "karmaBot" triggered with message "bad".


In the main.js file linked above, I am using the bot_name input (https://github.com/Legend-of-iPhoenix/UniChat-botAPI/blob/729b071764f0a6fc26784d76dbeaf6dc1ccaabb6/js/main.js#L33) from the constructor (https://github.com/Legend-of-iPhoenix/UniChat-botAPI/blob/729b071764f0a6fc26784d76dbeaf6dc1ccaabb6/js/main.js#L23) in the code to determine what name to display.

I initially assumed this was the problem. I thought that the bot_name variable might be changed each time the constructor is called, even though this seems strange.

I changed it to "this.name", which is the bot's name. This works elsewhere, but it didn't work there.

How can I fix this, and what exactly is happening?


I fixed it, but I can't quite explain how I fixed it or how my fix works, but it does.
Title: Re: UniChat!
Post by: _iPhoenix_ on January 11, 2018, 10:22:17 pm
We now have a chrome extension!

You can download the source from here (https://github.com/Legend-of-iPhoenix/Unichat-Chrome-Extension/archive/master.zip) (That's from my fork of the repository, which is currently the most functional version, AFAIK.)

Here's how you can install it:

Download from the link above!
Go to chrome://extensions and check the checkbox in the top left labeled "developer mode".
Click the "Load unpacked extension..." button and navigate to the downloaded folder.
You are done!

To chat with other UniChatters, you can click the UniChat icon in the extensions bar!

Note: Be sure not to delete the folder downloaded, unless you want to break the extension.

Huge thanks to LAX18 for creating the extension!
Title: Re: UniChat!
Post by: _iPhoenix_ on January 12, 2018, 10:50:04 pm
Thanks to me, you can join #UniChat-dev on EFnet!
Title: Re: UniChat!
Post by: _iPhoenix_ on January 13, 2018, 09:31:38 pm
I added a sweet active users bar, and you can see exactly who is online and has posted a message in the last 15 minutes, in real time! (depending on connection)

Check it out!
Title: Re: UniChat!
Post by: _iPhoenix_ on January 15, 2018, 03:41:05 pm
There is some planned downtime for UniChat now, starting 2 hours ago and ending when I am done. (EDIT: I'm done!)

When it is over, you guys will have private chatrooms!

It's technically usable but very buggy; I'm here, in the default chatroom (https://legend-of-iphoenix.github.io/UniChatDemo/) and in test, which is here (https://legend-of-iphoenix.github.io/UniChatDemo/?room=test).
Title: Re: UniChat!
Post by: _iPhoenix_ on January 15, 2018, 08:40:06 pm
[double post because of huge update]

UniChat private chatrooms are done, and here's how they work:

When you go to the main page, https://legend-of-iphoenix.github.io/UniChatDemo/ (https://legend-of-iphoenix.github.io/UniChatDemo/), you are automatically put into the default chat room! This is where we expect most of our users will be.

Just like IRC Channels, you can share room ("channel") names with each other. Each room has its own private list of online users and messages!

You can use the built-in hub (https://legend-of-iphoenix.github.io/UniChatDemo/hub/), or the simple form on the main page, below the settings bar (it might be below the message bar on some devices).

Additionally, you can create a private chatroom using a button under settings, with a random key that is highly unlikely to be guessed by others.