{"id":15033085,"url":"https://github.com/xmisao/x2ch","last_synced_at":"2025-04-09T21:23:41.948Z","repository":{"id":9071225,"uuid":"10842610","full_name":"xmisao/x2ch","owner":"xmisao","description":"2ch downloader and parser library","archived":false,"fork":false,"pushed_at":"2015-03-31T13:56:26.000Z","size":172,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T23:16:22.358Z","etag":null,"topics":["gem","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/xmisao.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}},"created_at":"2013-06-21T13:03:36.000Z","updated_at":"2023-12-15T05:40:58.000Z","dependencies_parsed_at":"2022-09-04T19:32:09.015Z","dependency_job_id":null,"html_url":"https://github.com/xmisao/x2ch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmisao%2Fx2ch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmisao%2Fx2ch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmisao%2Fx2ch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmisao%2Fx2ch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmisao","download_url":"https://codeload.github.com/xmisao/x2ch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785943,"owners_count":20995644,"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":["gem","ruby","ruby-gem"],"created_at":"2024-09-24T20:20:03.046Z","updated_at":"2025-04-09T21:23:41.932Z","avatar_url":"https://github.com/xmisao.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# x2ch\n\n- [https://rubygems.org/gems/x2ch](https://rubygems.org/gems/x2ch)\n- [https://github.com/xmisao/x2ch](https://github.com/xmisao/x2ch)\n\n## Description\n\nx2chは2chのダウンローダとパーサを備えたライブラリです。\nこのライブラリを使うとRubyで簡単に2chにアクセスできます。\n\n## Install\n\n    gem install x2ch\n\n## Examples\n\n2chのカテゴリーと板一覧を取得する。\nなおサーバからのダウンロードはgzipに対応しています。\n\n    require 'x2ch'\n    include X2CH\n    \n    bbs = Bbs.load\n    bbs.each{|category|\n      puts '- ' + category.name\n      category.each{|board|\n        puts ' - ' + board.name\n      }\n    }\n\nカテゴリー「趣味」の「アクアリウム」板のスレッド一覧を取得する。\n\n    require 'x2ch'\n    include X2CH\n    \n    bbs = Bbs.load\n    bbs['趣味']['アクアリウム'].each{|thread|\n      puts thread.name + '(' + thread.num.to_s + ')'\n    }\n\nアクアリウム板の最初のスレッドの投稿を取得する。\n\n    require 'x2ch'\n    include X2CH\n    \n    bbs = Bbs.load\n    bbs['趣味']['アクアリウム'].threads.first.each{|post|\n      puts \"#{post.name} \u003c\u003e #{post.mail} \u003c\u003e #{post.metadata} \u003c\u003e #{post.body}\"\n    }\n\nposts等の返却値はX2CH::Responseモジュールにより拡張されているため、レスポンスの情報を取得できます。\nこれによりLast-Modifiedに基づいて、If-Modified-Sinceによる更新確認が行えます。\n\n    require 'x2ch'\n    include X2CH\n    \n    bbs = Bbs.load\n    res = bbs['趣味']['アクアリウム'].threads.first.posts\n    puts res.status\n    puts res.last_modified\n    puts res.content_encoding\n    puts res.body_size\n    \n    begin\n      res = bbs['趣味']['アクアリウム'].threads.first.posts(res.last_modified.httpdate)\n      puts res.status\n      puts res.last_modified\n      puts res.content_encoding\n      puts res.body_size\n    rescue DownloadError =\u003e e\n      puts e.message\n    end\n\n## Author\n\n- [xmisao](http://www.xmisao.com/)\n\n## License\n\nThis library is distributed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmisao%2Fx2ch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmisao%2Fx2ch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmisao%2Fx2ch/lists"}