{"id":16513928,"url":"https://github.com/twin/pythonxatbot","last_synced_at":"2025-10-04T19:37:55.357Z","repository":{"id":106444932,"uuid":"63462778","full_name":"TwiN/PythonXatBot","owner":"TwiN","description":"DEPRECATED A Xat bot in Python (2.7) that does not require the (bot) power.","archived":false,"fork":false,"pushed_at":"2019-02-10T04:42:40.000Z","size":149,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-20T14:43:35.208Z","etag":null,"topics":["bot","deprecated","python","xat"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TwiN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["TwiN"]}},"created_at":"2016-07-16T03:03:59.000Z","updated_at":"2024-10-28T20:32:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e58df91-a294-4097-b538-8bfabee79890","html_url":"https://github.com/TwiN/PythonXatBot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TwiN/PythonXatBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2FPythonXatBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2FPythonXatBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2FPythonXatBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2FPythonXatBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TwiN","download_url":"https://codeload.github.com/TwiN/PythonXatBot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2FPythonXatBot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278366599,"owners_count":25975091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","deprecated","python","xat"],"created_at":"2024-10-11T16:10:53.356Z","updated_at":"2025-10-04T19:37:55.339Z","avatar_url":"https://github.com/TwiN.png","language":"Python","funding_links":["https://github.com/sponsors/TwiN"],"categories":[],"sub_categories":[],"readme":"# PythonXatBot\n\nA Xat bot in Python that does not require the (bot) power.\n\n## Requirements\npython 2.7\n\n## How to use\n\n1. open the file bot.py and edit these variables: botID, botK1, botK2 to your bot settings (you can generate these parameters on [https://xat.com/web_gear/chat/auser3.php](https://xat.com/web_gear/chat/auser3.php)\n\n2. (optional) edit the botDisplayName, botAvatar and botHomepage\n\n3. open the file ```chatNames.txt``` and edit the name of the xats you want your bot to join ( one per line)\n\n## Update (2019-02-09)\n\nThis project is no longer actively maintained.\n\n## Update (2018-11-03)\n\nThe Xat API on my website is now deprecated and will be removed in the next few days.\n\n\n## Update (2018-10-07)\n\nI will deprecate the API for getting Xat chat's info _very_ soon. I have long since considered Xat to be dead, but I kept the API up in hope that Xat would eventually make changes. [They didn't](https://trends.google.com/trends/explore?date=today%205-y\u0026q=Xat,Discord) - [Xat still uses Flash](https://trends.google.com/trends/explore?date=all\u0026geo=US\u0026q=Adobe%20Flash)\n\n\nHere's a quick Java implementation, if somebody wants to make their own API:\n\n```java\n@Service\n@Deprecated\npublic class XatApiService {\n\t\n\tprivate static final Logger logger = LoggerFactory.getLogger(XatApiService.class);\n\t\n\tprivate List\u003cInteger\u003e chatPorts = List.of(10007, 10008, 10019, 10038);\n\t/** You can find those at https://xat.com/web_gear/chat/ip2.htm */\n\tprivate List\u003cString\u003e chatIps = List.of(\"fwdelb-166679406.us-east-1.elb.amazonaws.com\", \"fwdelb2-1789343474.us-east-1.elb.amazonaws.com\");\n\t\n\t\n\tpublic String generateXatData(String chatName) throws IOException {\n\t\treturn chatName + \":\" + getXatChatId(chatName) + \":\" + getRandomXatChatIP() + \":\" + getRandomXatChatPort();\n\t}\n\t\n\t\n\tprivate String getRandomXatChatIP() {\n\t\treturn chatIps.get((int)(Math.ceil(Math.random() * (chatIps.size())))-1);\n\t}\n\t\n\t\n\tprivate Integer getRandomXatChatPort() {\n\t\treturn chatPorts.get((int)(Math.ceil(Math.random() * (chatPorts.size())))-1);\n\t}\n\t\n\t\n\tpublic String getXatChatId(String chatName) throws IOException {\n\t\tString chatId = \"\";\n\t\tURL siteUrl = new URL(\"https://xat.com/\" + chatName);\n\t\tURLConnection connection = siteUrl.openConnection();\n\t\ttry (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {\n\t\t\tString line = \"\";\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tif (line.toLowerCase().contains(\"name=\\\"chat\\\" flashvars=\\\"id=\")) {\n\t\t\t\t\tchatId = StringUtils.getBetween(line.toLowerCase(), \"id=\", \"\u0026\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"[getXatChatId] Failed to fetch chat id\", e);\n\t\t}\n\t\treturn chatId;\n\t}\n\t\n}\n```\n\n## Update (2018-07-27)\n\nThis project is now maintained by [x00x90](https://github.com/x00x90)\n\n## Update (2018-07-22)\n\nThis project is no longer actively maintained.\n\n-------------------------\n\n## Changelogs\n\n**2018-07-27**: This bot now supports multiple xats at the same time\n\n**2016-12-18**: Fixed bot not connecting issue. Reason: Xat servers have new ips. No modification was made on the bot script itself because the API on my website was the one that needed to be updated to give the right ips. ( https://twinnation.org/api/xat?chat=ring0 )\n\n\n## Compatibility and Python version\n\nThis bot was made using **Python 2.7.10**, meaning it *most likely* works for 2.7.x. As for those of you who **absolutely** want to use 3.x, then you can learn about how to convert it easily by looking up *lib2to3* online.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwin%2Fpythonxatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwin%2Fpythonxatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwin%2Fpythonxatbot/lists"}