{"id":28573752,"url":"https://github.com/sobotics/swiftchatse","last_synced_at":"2025-06-10T21:19:49.503Z","repository":{"id":63921739,"uuid":"75008680","full_name":"SOBotics/SwiftChatSE","owner":"SOBotics","description":"A Swift framework for creating chatbots for Stack Exchange.","archived":false,"fork":false,"pushed_at":"2020-08-03T18:56:39.000Z","size":402,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-29T09:04:38.822Z","etag":null,"topics":["stack-exchange","stack-exchange-chat","stack-overflow","swift","swift-package-manager"],"latest_commit_sha":null,"homepage":"http://swiftchatse.sobotics.org/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SOBotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-28T19:50:47.000Z","updated_at":"2020-08-03T18:56:26.000Z","dependencies_parsed_at":"2023-01-14T14:15:14.455Z","dependency_job_id":null,"html_url":"https://github.com/SOBotics/SwiftChatSE","commit_stats":null,"previous_names":[],"tags_count":96,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOBotics%2FSwiftChatSE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOBotics%2FSwiftChatSE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOBotics%2FSwiftChatSE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOBotics%2FSwiftChatSE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SOBotics","download_url":"https://codeload.github.com/SOBotics/SwiftChatSE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOBotics%2FSwiftChatSE/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259152809,"owners_count":22813228,"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","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":["stack-exchange","stack-exchange-chat","stack-overflow","swift","swift-package-manager"],"created_at":"2025-06-10T21:19:15.618Z","updated_at":"2025-06-10T21:19:49.484Z","avatar_url":"https://github.com/SOBotics.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftChatSE\n\n[![Build Status](https://travis-ci.org/SOBotics/SwiftChatSE.svg)](https://travis-ci.org/SOBotics/SwiftChatSE)\n\nA Swift library for Stack Exchange chat\n\nSwiftChatSE is a library made from [FireAlarm-Swift](//github.com/NobodyNada/FireAlarm/tree/swift)'s chat code.  It works on macOS and Linux.\n\n## Example\n\nHere are instructions to build a simple program which posts \"Hello, world!\" in SOBotics.\n\n### Installing libwebsockets\n\n`brew` and `apt-get` provide different versions of `libwebsockets`, and both are outdated, so you'll have to install it from source.  Make sure you have OpenSSL and CMake installed, and run the following commands to download and install `libwebsockets` from [here](https://github.com/warmcat/libwebsockets):\n\n    git clone https://github.com/warmcat/libwebsockets.git\n    cd libwebsockets\n    mkdir build\n    cd build\n    export OPENSSL_ROOT_DIR=$(brew --prefix openssl)\n    cmake ..\n    make\n    sudo  make install\n    \n### Writing and building the program\n\nCreate a Swift Package Manager project:\n\n    mkdir ChatTest\n    cd ChatTest\n    swift package init --type executable\n    \nModify `Package.swift`:\n\n    import PackageDescription\n    \n    let package = Package(\n        name: \"ChatTest\",\n        dependencies: [\n            .Package(url: \"git://github.com/SOBotics/SwiftChatSE\", majorVersion: 4)\n        ]\n    )\n\nNow write the code, in `Sources/main.swift`:\n\n    import SwiftChatSE\n    \n    let email = \"\u003cemail\u003e\"\n    let password = \"\u003cpassword\u003e\"\n    \n    //Create a Client and log in to Stack Overflow.\n    let client = Client(host: .StackOverflow)\n    try! client.login(email: email, password: password)\n    \n    //Join a chat room.\n    let room = ChatRoom(client: client, roomID: 111347)\t//SOBotics\n    try! room.join()\n    \n    //Post a message.\n    room.postMessage(\"Hello, world!\")\n    \n    \n    room.leave()\n    \nYou'll have to run the following command to build:\n\n    swift build -Xswiftc -lwebsockets -Xswiftc -I/usr/local/opt/openssl/include -Xswiftc -I/usr/local/include -Xlinker -lwebsockets -Xlinker -L/usr/local/lib\n    \nAfter running the `swift build` command, the executable will be placed in the directory `.build`.  If you want to use Xcode to develop, just copy `swiftchatse.xcconfig` to your project directory and run:\n```\nswift package generate-xcodeproj --xcconfig-overrides swiftchatse.xcconfig\n```    \nto generate an Xcode project.  You'll have to recreate the project if you add files or change package settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsobotics%2Fswiftchatse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsobotics%2Fswiftchatse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsobotics%2Fswiftchatse/lists"}