{"id":19942825,"url":"https://github.com/uakihir0/socialhub","last_synced_at":"2025-05-03T15:32:34.794Z","repository":{"id":41988982,"uuid":"140700591","full_name":"uakihir0/SocialHub","owner":"uakihir0","description":"SocialHub is multi social media (SNS) client for Java and Objective-C (with J2ObjC)","archived":false,"fork":false,"pushed_at":"2024-02-17T08:40:46.000Z","size":1785,"stargazers_count":51,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-02-17T09:26:52.773Z","etag":null,"topics":["j2objc","java","kotlin","sns","swift"],"latest_commit_sha":null,"homepage":"","language":"Java","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/uakihir0.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-07-12T10:51:13.000Z","updated_at":"2024-02-17T09:26:57.767Z","dependencies_parsed_at":"2024-02-17T09:26:57.322Z","dependency_job_id":"9e60ebb9-acdb-452e-9a70-b4287df70983","html_url":"https://github.com/uakihir0/SocialHub","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FSocialHub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FSocialHub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FSocialHub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FSocialHub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uakihir0","download_url":"https://codeload.github.com/uakihir0/SocialHub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224365306,"owners_count":17299156,"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":["j2objc","java","kotlin","sns","swift"],"created_at":"2024-11-13T00:14:19.828Z","updated_at":"2024-11-13T00:14:20.332Z","avatar_url":"https://github.com/uakihir0.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SocialHub [![](https://jitpack.io/v/uakihir0/socialhub.svg)](https://jitpack.io/#uakihir0/socialhub) [![Build Status](https://github.com/uakihir0/SocialHub/workflows/J2ObjC%20Build/badge.svg)](https://travis-ci.com/uakihir0/SocialHub)\n\nSocialHub is a multi social network service's API library written in **Java**, and can be complied to **Objective-C**\nby [J2ObjC]. and we can also use it with **Kotlin** and **Swift** too.\n\n## List of Social Media (SNS)\n\n### Available\n\n* **MicroBlog**\n  * [**Twitter**](https://twitter.com/) ( use [library](https://github.com/uakihir0/twitter4j) based\n  on [twitter4j](https://github.com/yusuke/twitter4j) )\n  * [**Mastodon**](https://github.com/tootsuite/mastodon) ( use [library](https://github.com/uakihir0/mastodon4j) based\n    on [mastodon4j](https://github.com/hecateball/mastodon4j) )\n      * [**Pleroma**](https://pleroma.social/) (Mastodon API compatibility)\n      * [**PixelFed**](https://pixelfed.org/) (Mastodon API compatibility)\n  * [**Misskey**](https://join.misskey.page/ja/) ( use [library](https://github.com/uakihir0/misskey4j) )\n  * [**Bluesky**](https://blueskyweb.xyz/) ( use [library](https://github.com/uakihir0/bsky4j) )\n* [**Slack**](https://slack.com/) ( use [library](https://github.com/uakihir0/jslack) based\n  on [jslack](https://github.com/seratch/jslack) )\n* [**Tumblr**](https://www.tumblr.com/) ( use [library](https://github.com/uakihir0/jumblr) based\n  on [jumblr](https://github.com/tumblr/jumblr) )\n\nMost of all libraries are modified (remove complex dependency and unused functions) for compilation to Objective-C\nwith [J2ObjC].\n\n### Future Works\n\n* [**Facebook**](https://www.facebook.com/)\n* [**LinkedIn**](https://www.linkedin.com/)\n* [**Pinterest**](https://www.pinterest.com/)\n* [**Snapchat**](https://www.snapchat.com/)\n* [**Matrix**](https://matrix.org/)\n* [**Microsoft Teams**](https://www.microsoft.com/ja-jp/microsoft-teams/group-chat-software)\n\n### Difficult to Handle\n\n* [**Discord**](https://discordapp.com/)\n    * [Discord API](https://discordapp.com) does not provide the way to write message api as user to channel.\n* [**Instagram**](https://www.instagram.com/)\n    * [Instagram API](https://www.instagram.com/developer/) is duplicated,\n      and [new Graph API](https://developers.facebook.com/products/instagram/) is business use.\n\n## Detail Documents\n\n[**See Detail Documents**](./docs/README.md)\n\n## Code Sample\n\n### Authorization\n\nCode sample to authorize account and get account information.\n\n```java\n/* JAVA */\n// 1. Make Authorized Account Object\n\n// For Twitter\nTwitterAuth auth = SocialHub.getTwitterAuth(CONSUMER_KEY, CONSUMER_SECRET);\nAccount account = auth.getAccountWithAccessToken(ACCESS_TOKEN, ACCESS_SECRET);\n\n// For Mastodon\nMastodonAuth auth = SocialHub.getMastodonAuth(HOST);\nAccount account = auth.getAccountWithAccessToken(ACCESS_TOKEN);\n\n\n// 2. Request To SNS (all sns same interface)\nUser user = account.action().getUserMe();\nSystem.out.println(user.getName());\n```\n\n### Group Timeline\n\nCode sample to get unified timeline comments from account group (two or more accounts).\n\n```java\n/* JAVA */\n// 1. Make Account Group\nAccountGroup accounts = new AccountGroup();\naccounts.addAccount((Account)twitterAccount);\naccounts.addAccount((Account)mastodonAccount);\n\n// 2. Get Home New Timeline\nCommentGroup comments = accounts.action().getHomeTimeLine();\n\n// 3. Get Past Timeline\nCommentGroup pasts = comments.action().getPastComments();\n```\n\nif you want more samples, please see [detail documents](./docs/README.md) and test code.\n\n## J2ObjC\n\n[J2ObjC] is project aim to compile **Java** code to **Objective-C** code. SocialHub is adapted with J2ObjC compilation\nSo, you can use SocialHub as an Objective-C library (also use in Swift) in MacOS or iOS application development. Travis\nCI compiles SocialHub and make [**SocialHub CocoaPods Repository**](https://dev.azure.com/SocialHub/_git/ObjCBinary).\nIt's an easy way to use this repository rather than compiling yourself.\n\n### Compile to Objective-C\n\nTo compile SocialHub to Objective-C framework, do next instructions. **It's only executable on MacOS\nenvironment** ([This file](./.github/workflows/build.yml) is script of followings.)\n\n1. Download latest J2ObjC builds and unzip\n\n   See: \u003chttps://github.com/google/j2objc/releases\u003e\n\n2. Set J2ObjC path in `local.properties` file\n\n    ```shell\n    j2objc.home=${PATH}\n    ```\n\n3. Build Objective-C libraries\n\n   Build commands is written in `j2objc.sh` file. so execute it or do next instructions. ```j2objc.gradle``` is gradle\n   settings to make Objective-C library.\n\n    ```shell\n    ./gradlew -b j2objc.gradle clean :j2objcAssemble -x test\n    ```\n\n4. Add dependency in your project\n\n   After J2ObjC compile, `cocoapod.spec` will be created in `./build/j2objcOutputs` folder, so you write SocialHub\n   dependency in your CocoaPods project's `Podfile` like\n\n    ```\n    def j2objc_socialhub\n        pod 'j2objc-SocialHub-debug', :configuration =\u003e ['Debug'], :path =\u003e '../shared/build/j2objcOutputs'\n        pod 'j2objc-SocialHub-release', :configuration =\u003e ['Release'], :path =\u003e '../shared/build/j2objcOutputs'\n    end\n    \n        ...\n        NOTE: this line must be added manually for the relevant targets:\n        j2objc_socialhub\n        ...\n    ```\n\n5. Use SocialHub in Swift\n\n   Make bridging header, and write as following.\n\n    ```\n    #include \"SocialHubHeader.h\"\n    ```\n\n## Application\n\n* iOS: [SocialHub](https://apps.apple.com/us/app/id1474451582)\n    * This library is converted to Objective-C and used in Swift.\n\n## Author\n\nTwitter: [@uakihir0](https://twitter.com/uakihir0)  \nGitHub: [uakihir0](https://github.com/uakihir0)\n\n## License\n\n**MIT**\n\n[J2ObjC]: https://developers.google.com/j2objc/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuakihir0%2Fsocialhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuakihir0%2Fsocialhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuakihir0%2Fsocialhub/lists"}