{"id":17436039,"url":"https://github.com/anond0rf/vecchioclient","last_synced_at":"2025-03-28T01:21:41.828Z","repository":{"id":257808095,"uuid":"865640981","full_name":"anond0rf/vecchioclient","owner":"anond0rf","description":"VecchioClient is a Go library for posting on vecchiochan.com","archived":false,"fork":false,"pushed_at":"2024-10-23T19:24:31.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T05:46:42.115Z","etag":null,"topics":["client","go","golang","imageboard","rest","vecchiochan","vecchioclient","vichan","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anond0rf.png","metadata":{"files":{"readme":"README-en.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,"publiccode":null,"codemeta":null}},"created_at":"2024-09-30T21:42:37.000Z","updated_at":"2024-10-23T19:16:10.000Z","dependencies_parsed_at":"2024-10-19T08:53:12.963Z","dependency_job_id":"9a69936a-3fa0-4f72-a11d-cfa2770378af","html_url":"https://github.com/anond0rf/vecchioclient","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"3b7c05deb94d3b53dc17a702d5bf6187bb0410c7"},"previous_names":["anond0rf/vecchioclient"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anond0rf%2Fvecchioclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anond0rf%2Fvecchioclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anond0rf%2Fvecchioclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anond0rf%2Fvecchioclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anond0rf","download_url":"https://codeload.github.com/anond0rf/vecchioclient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245950516,"owners_count":20699085,"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":["client","go","golang","imageboard","rest","vecchiochan","vecchioclient","vichan","wrapper"],"created_at":"2024-10-17T10:01:39.738Z","updated_at":"2025-03-28T01:21:41.786Z","avatar_url":"https://github.com/anond0rf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n[![English](https://img.shields.io/badge/lang-en-blue.svg)](README-en.md) [![Italiano](https://img.shields.io/badge/lang-it-blue.svg)](README.md) ![License](https://img.shields.io/github/license/anond0rf/vecchioclient) [![GitHub Release](https://img.shields.io/github/v/release/anond0rf/vecchioclient?label=release)](https://github.com/anond0rf/vecchioclient/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/anond0rf/vecchioclient)](https://goreportcard.com/report/github.com/anond0rf/vecchioclient) [![Go Version](https://img.shields.io/github/go-mod/go-version/anond0rf/vecchioclient)](https://github.com/anond0rf/vecchioclient) [![GoDoc](https://godoc.org/github.com/anond0rf/vecchioclient?status.svg)](https://godoc.org/github.com/anond0rf/vecchioclient)\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/anond0rf/vecchioclient\"\u003e\n    \u003cimg src=\"logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\u003ch3 align=\"center\"\u003eVecchioClient\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cstrong\u003eVecchioClient\u003c/strong\u003e is a Go library for posting on \u003ca href=\"https://vecchiochan.com/\"\u003evecchiochan.com\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"#installation\"\u003e\u003cstrong\u003eGet Started »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/anond0rf/vecchioclient/blob/main/cmd/example-client/main.go\"\u003eExample Code\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/anond0rf/vecchioclient/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/anond0rf/vecchioclient/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Features\n\nThe library wraps around the reverse-engineered `/post.php` endpoint of [NPFchan](https://github.com/fallenPineapple/NPFchan) and exposes a client that abstracts away the details of form submission and request handling.  \nThe following features are provided by the client:\n\n- Post new threads to specific boards\n- Reply to existing threads\n\nCustom configuration is also possible for injecting custom `http.Client`, `User-Agent` and logger and for enabling verbose logging.  \nNo read functionality is provided as NPFchan already exposes the vichan  [API](https://github.com/vichan-devel/vichan-API/).\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Usage](#usage)\n   - [Basic Client Usage](#basic-client-usage)\n     - [Posting a New Thread](#posting-a-new-thread)\n     - [Posting a Reply](#posting-a-reply)\n   - [Custom Client Configuration](#custom-client-configuration)\n3. [License](#license)\n\n## Installation\n\nTo install VecchioClient, use `go get`:\n\n```bash\ngo get github.com/anond0rf/vecchioclient\n```\n\n## Usage\n\n### Basic Client Usage\n\nVecchioClient offers a simple and straightforward API to interact with vecchiochan. Here's how to get started:\n\n1. Import the client into your Go code:\n\n    ```go\n    import \"github.com/anond0rf/vecchioclient/client\"\n    ```\n\n2. Create a client:\n   \n    ```go\n    vc := client.NewVecchioClient()\n    ```\n\n3. Use the client to interact with vecchiochan, such as posting a new thread or replying to an existing one.  \n\n    - ##### Posting a New Thread\n    \n    ```go\n    thread := client.Thread{\n\t\tBoard:    \"b\",\n\t\tName:     \"\",\n\t\tSubject:  \"\",\n\t\tEmail:    \"\",\n\t\tSpoiler:  false,\n\t\tBody:     \"This is a new thread on board /b/\",   // Thread message\n\t\tEmbed:    \"\",\n\t\tPassword: \"\",\n\t\tSage:     false,               // Prevents bumping and replaces email with \"rabbia\"\n\t\tFiles:    []string{`C:\\path\\to\\file.jpg`},\n\t}\n\n    id, err := vc.NewThread(thread)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to post thread %+v. Error: %v\\n\", thread, err)\n\t}\n\tfmt.Printf(\"Thread posted successfully (id: %d) - %+v\\n\", id, thread)\n    ```\n\n    If the operation succeeds, the **id** of the newly-created thread is returned.  \n    Please note that you do not need to set all fields to instantiate the `Thread` struct and you can do so with a smaller set:\n\n    ```go\n    thread := client.Thread{\n\t\tBoard:    \"b\",\n\t\tBody:     \"This is a new thread on board /b/\",   // Thread message\n\t\tFiles:    []string{`C:\\path\\to\\file.jpg`},\n\t}\n    ```\n\n    In this case, default values will be assigned to the other fields.  \n    **Board** is the only **mandatory** field checked by the client but keep in mind that, as the settings vary across boards, more fields are probably required for posting (e.g. you can't post a new thread with no embed nor files on /b/).\n\n    - ##### Posting a Reply\n\n    ```go\n    reply := client.Reply{\n\t\tThread:   1,\n\t\tBoard:    \"b\",\n\t\tName:     \"\",\n\t\tEmail:    \"\",\n\t\tSpoiler:  false,\n\t\tBody:     \"This is a new reply to thread #1 of board /b/\",    // Reply message\n\t\tEmbed:    \"\",\n\t\tPassword: \"\",\n\t\tSage:     false,            // Prevents bumping and replaces email with \"rabbia\"\n\t\tFiles:    []string{`C:\\path\\to\\file1.mp4`, `C:\\path\\to\\file2.webm`},\n\t}\n\n    id, err = vc.PostReply(reply)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to post reply %+v. Error: %v\\n\", reply, err)\n\t}\n\tfmt.Printf(\"Reply posted successfully (id: %d) - %+v\\n\", id, reply)\n    ```\n\n    If the operation succeeds, the **id** of the reply is returned.  \n    Please note that you do not need to set all fields to instantiate the `Reply` struct and you can do so with a smaller set:\n\n    ```go\n    reply := client.Reply{\n        Thread:   1,\n\t\tBoard:    \"b\",\n\t\tBody:     \"This is a new reply to thread #1 of board /b/\",   // Reply message\n\t}\n    ```\n\n    In this case, default values will be assigned to the other fields.  \n    **Board** and **Thread** are the only **mandatory** fields checked by the client but keep in mind that, as the settings vary across boards, more fields are probably required for replying.\n\n### Custom Client Configuration\n\nCustom client configuration is done by creating a `Config` struct with the needed values like in the example below:\n\n```go\nconfig := client.Config{\n    Client:    \u0026http.Client{Timeout: 10 * time.Second},                 // Custom HTTP client\n    Logger:    log.New(os.Stdout, \"vecchioclient: \", log.LstdFlags),    // Custom logger\n    UserAgent: \"MyCustomUserAgent/1.0\",                                 // Custom User-Agent\n    Verbose:   true,                                                    // Enable/Disable detailed logging\n}\n\nvc := client.NewVecchioClientWithConfig(config)\n```\n\n## License\n\nVecchioClient is licensed under the [LGPL-3.0 License](https://www.gnu.org/licenses/lgpl-3.0.html). \n\nThis means you can use, modify, and distribute the software, provided that any modified versions are also licensed under the LGPL-3.0. \n\nFor more details, please see the full text of the license in the [LICENSE](./LICENSE) file.\n\nCopyright © 2024 anond0rf\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanond0rf%2Fvecchioclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanond0rf%2Fvecchioclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanond0rf%2Fvecchioclient/lists"}