Difference between revisions of "User:Ethan"

From xat wiki
Jump to: navigation, search
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
+
__NOTOC__
{{power-box
+
SetScroller is a feature aimed at advanced users who want to set the chat scroller automatically from their server. e.g. showing tweets, displaying now/next on their radio station.
|power=manage|heading= <translate>
 
<!--T:25-->
 
Manage group users
 
</translate>
 
|status= <translate>
 
<!--T:26-->
 
group power
 
</translate>
 
|info= <translate>
 
<!--T:1-->
 
Manage is a group power that allows you to manage users on your chat.</translate>
 
  
<translate><!--T:2-->
+
To use it, you will need your chat's '''id''' and '''pw''', which can be found in your chat's Extra features link.
When it is assigned, you have the ability to save and restore ranks on your chat.
 
</translate>
 
==Backup users==
 
<translate>
 
<!--T:3-->
 
To backup your chat's CSV, click on '''Edit''' under your chat, enter your group's password and click '''Backup Users'''.
 
</translate>
 
If you're looking for regular automated backups, then see: [[Backup]].
 
{{img|image=https://i.imgur.com/mstUWVF.png|float=right|description=<translate><!--T:11-->
 
(example 1) Button layout.</translate>}}
 
==<translate><!--T:4-->
 
Managing</translate>==
 
<translate>
 
<!--T:23-->
 
Your xat group backup is saved in an '''.xatu''' file, this includes all your staff (members, mods, owners, main owners), guests and banned users.
 
  
<!--T:6-->
+
==Usage==
To edit your xatu file, right click and open with Notepad. Make sure to keep ".xatu" format otherwise it will not work.
 
  
<!--T:27-->
+
You can use the API manually via a web page here: http://xat.com/web_gear/chat/SetScroller.php
Entries are using the following format: ''User ID,Reserved,Time,Power ID,Reserved,Rank,Forever Ban,Ban Status,Mod History,Dunce/Badge/Naughtystep/Yellowcard,''
 
  
<!--T:8-->
+
'''Example''':
*'''User ID'''
+
{{pre|<nowiki>http://xat.com/web_gear/chat/SetScroller.php?Message=Hello%20all!&id=12345&pw=1234567890</nowiki>}}
 +
Or you can access the API using a programming language.
  
<!--T:28-->
+
'''Example of how to access the API in PHP''':
*'''Reserved''' - Ignore this, but do not remove it otherwise you will break the CSV. Leave it blank.
+
{{pre|<nowiki>
 +
$message = "Hello all!"
 +
$id = 12345;
 +
$pw = 1234567890;
  
<!--T:29-->
+
$url = "http://xat.com/web_gear/chat/SetScroller.php?Message=".urlencode($message)."&id={$id}&pw={$pw}";
*'''Time''' - You can convert, alter, make longer or reduce ban time for example. See below for information on how to get the time code.
+
$ch = curl_init();
 
+
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
<!--T:30-->
+
curl_setopt ($ch, CURLOPT_URL, $url);
*'''Power ID''' - You can edit in case you want to gameban a user. For example, set it to '''134''' for snakeban and set the user as '''banned'''. Otherwise leave it as 0. See [[Powers]] for a list of power IDs.
+
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
 
+
$content = curl_exec ($ch);
<!--T:31-->
+
print "$content\n";
*'''Reserved''' - Ignore this again, but do not remove it otherwise you will break the CSV. Just set it to 0.
+
curl_close ($ch);
 +
</nowiki>
 +
}}
  
<!--T:32-->
+
'''Notes''':
*'''Rank''' - Allowed values: guest, tempmember, member, tempmod, mod, sinbin, tempowner, owner and main owner.
 
  
<!--T:33-->
+
*You are limited to 1 update every minute.
*'''Forever Ban''' - Either leave blank or set as '''forever''' to forever ban a user.  Allowed values: ''blank'', forever.
 
  
<!--T:34-->
+
*The above uses the GET HTTP method, POST will also work.
::''Note: If you set it to forever, you cannot also set the user as banned below.''
 
  
<!--T:35-->
+
*If you reset your chat you will need to update your software to go to the new ID and PW. If you change your group password you'll need to update to use the new pass.
*'''Ban Status''' - Allowed values: ''blank'', banned, gagged, muted.
 
 
 
<!--T:36-->
 
*'''Mod History''' - Allowed values: ''blank'', wasmod.
 
 
 
<!--T:37-->
 
*'''Dunce/Badge/Naughtystep/Yellowcard''' - Allowed values: ''blank'', dunced, badge, naughty, yellow, red.
 
 
 
<!--T:7-->
 
Example of 4 xatu lines:</translate>
 
 
 
*1461971482,,1414172247,0,2,guest,,,,,
 
 
 
*1462485906,,1414172247,0,2,guest,,,,,
 
 
 
*1472039264,,1414756425,0,4608,guest,,gagged,,dunced,
 
 
 
*1473774400,,1414621683,0,130,guest,forever,,,,
 
<translate>
 
 
 
<!--T:19-->
 
''Note: Leaving a value blank means that you omit it from the CSV, however you must still put commas between where that value was supposed to be.''
 
 
 
<!--T:20-->
 
For example, if you want to create a 1 hour snakebanned guest with ID number 1111 that has no mod history and dunce/badge/naughtystep/yellowcard, the line would be:
 
 
 
<!--T:21-->
 
1111,,1414867082,134,0,guest,,banned,,,
 
 
 
<!--T:22-->
 
See below for information on converting times. The one used in the example above (1414867082) will not apply in the future as the system checks the current time against the time code you put in. So if you want a 1 hour ban, you set the current time code higher by an hour and use that.
 
 
 
<!--T:9-->
 
In case of a ban the rank time is when it will end. This way you can also ban users manually and choose when it will end (by altering the user xatu line with notepad)
 
</translate>
 
==<translate><!--T:10-->
 
Restore users</translate>==
 
{{img|image=http://i.imgur.com/WLSL8bd.gif|float=right|description=
 
(example 2) Restoring ranks.}}
 
<translate><!--T:12-->
 
To restore your chat (staff, banned statuses etc) you need your '''.xatu''' file.
 
Enter your group page, click on "Edit" and choose the file to restore from, after that click on '''Restore Users''' button (see example 1)
 
 
 
<!--T:13-->
 
Use kickall power to update the chat in case you put a new xatu. A single ID can sign out and in (refresh) and its rank or any other changes made will be updated.</translate>
 
 
 
==<translate><!--T:14-->
 
CSV Editors</translate>==
 
<translate><!--T:24-->
 
You can use external tools to edit .xatu files. Only use sites you can trust.
 
 
 
<!--T:15-->
 
Trusted CSV editors:
 
*[<tvar|link>http://xatalert.com/manage-csv-editor/</> Manage CSV Editor by xatAlert]
 
</translate>
 
==<translate><!--T:16-->
 
Times</translate>==
 
{{img|image=https://i.imgur.com/PeyXjaL.png|float=left|description=<translate><!--T:17-->
 
(example 3) Time converter.</translate>}}
 
<translate><!--T:18-->
 
Go to <tvar|link2>https://epochconverter.com</> then enter the 2nd part of numbers '''1414172247''' (see example 3)
 
</translate>
 
|smiley1=manage
 
}}
 
__NOTOC__
 

Revision as of 12:35, 4 September 2016

SetScroller is a feature aimed at advanced users who want to set the chat scroller automatically from their server. e.g. showing tweets, displaying now/next on their radio station.

To use it, you will need your chat's id and pw, which can be found in your chat's Extra features link.

Usage[edit]

You can use the API manually via a web page here: http://xat.com/web_gear/chat/SetScroller.php

Example:

http://xat.com/web_gear/chat/SetScroller.php?Message=Hello%20all!&id=12345&pw=1234567890

Or you can access the API using a programming language.

Example of how to access the API in PHP:

$message = "Hello all!"
$id = 12345;
$pw = 1234567890;

$url = "http://xat.com/web_gear/chat/SetScroller.php?Message=".urlencode($message)."&id={$id}&pw={$pw}";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
$content = curl_exec ($ch);
print "$content\n";
curl_close ($ch);

Notes:

  • You are limited to 1 update every minute.
  • The above uses the GET HTTP method, POST will also work.
  • If you reset your chat you will need to update your software to go to the new ID and PW. If you change your group password you'll need to update to use the new pass.