aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fix: extract text from tiptap bodies, and read the right description field (#4)v0.3.3Christian Cleberg2026-07-153-50/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking the library against the live API disproved what its comments claimed. Comment and Description were handing back raw JSON blobs, and the parser this package has always carried could not have prevented it. DeviantArt no longer stores rich text as Draft.js. It uses tiptap: Draft.js, what we parse: {"blocks":[{"text":"..."}]} tiptap, what DA sends: {"version":1,"document":{"type":"doc",...}} Across 34 live comments: 33 tiptap, 0 Draft.js, and 33 whose .Comment was the raw JSON. flattenMarkup now walks the tiptap tree — text nodes joined per block, hardBreak as a newline, entities decoded — and keeps the Draft.js path for old bodies that still carry it. Nodes with no text of their own (images, galleries, emotes) drop out, as they always did. The description had a second, larger bug behind that one. It lives in Extended.DescriptionText, not TextContent, which GetDeviation read: of 24 deviations sampled, 23 populated the former and 1 the latter. So Post.Description was empty for nearly every deviation, and the txt[1] guard removed in 3dad0ea was never what stood in the way. Prefer Extended.DescriptionText and fall back, since either may be the one set. Verified against the live API rather than by reading: comments still raw JSON went 33/34 to 0/34, and descriptions that were "" now return prose. Also corrects the doc comments that asserted the Draft.js story on pkg.go.dev, and notes that flattening drops images, links, and emotes.
* chore: drop the release workflow (#3)Christian Cleberg2026-07-151-23/+0
| | | | | | | | | | | | | The workflow turned a v* tag into an empty GitHub release. For a library with no binaries to attach, that is exactly what the Releases button in the UI does, so it earned nothing and had never once succeeded: the v0.3.1 runs were denied by a read-only GITHUB_TOKEN, and the v0.3.2 run raced a release published by hand and got a 422. Releases are cut in the UI, which also creates the tag. Go resolves tags through the module proxy, so nothing about publishing depends on this. Worth knowing if it ever comes back: it passed github.ref, so the title rendered as "Release refs/tags/v0.3.2". It wants github.ref_name.
* docs: document the exported API, and fix five bugs found writing it (#2)v0.3.2Christian Cleberg2026-07-1510-84/+470
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * docs: translate Russian comments and document exported API The package carried 35 Russian comments and no doc comments on its exported identifiers, so pkg.go.dev rendered a bare list of signatures. Translate the Russian to English and give every exported identifier a doc comment in godoc form. Add doc.go with a package overview covering the guest-session requirement, the Error-as-struct convention, and CloudFront blocking. The comments record what the signatures cannot: that UpdateCSRF must run first and that its token expires, that Error is a struct and so is never nil, that Thread is one comment rather than a thread, and that GetComments' page parameter costs one request per page. Comments only; the struct field realignment is gofmt's, from doc comments splitting alignment groups. Refs #1 * add CODEOWNERS * fix: stop the library killing its caller, and flatten text correctly Writing doc comments for the exported API surfaced behavior too alarming to document and leave alone. A library should never terminate the process that imports it. Crashes: - GetComments panicked on a comment with an empty body: the shape check read m[0] and m[len(m)-1] with no length check. - Group.Favourites and Group.Gallery indexed their variadic folderid without checking len, so omitting it — which the signature invites — panicked. Omitting it now means 0. - AEmedia and PerformSearch called log.Fatalln on a bad argument rune, terminating the caller. Both now return an error, which their signatures already allowed for. Draft.js flattening, in the same code both callers share: - The block loop assigned rather than accumulated, so every block but the last was dropped and a multi-paragraph body came back as its closing line alone. Blocks are block-level elements, so join them with newlines. - GetDeviation guarded on txt[1] == '{', the second character of a body that opens with {"blocks". It never fired, so descriptions were handed back as raw Draft.js JSON. It now shares flattenComment with GetComments rather than keeping its own copy. Both flattening fixes change output for existing callers. Refs #1
* fix codeql findingsChristian Cleberg2026-07-153-0/+9
|
* fix: convert deprecated release actionChristian Cleberg2026-07-141-4/+3
|
* fix: restore optional username in PerformSearch, apply gofmtv0.3.1Christian Cleberg2026-07-144-33/+29
| | | | | | | | | | | | The golangci-lint cleanup added a top-level `user == nil` guard to PerformSearch, but `user` is variadic and only required for the 'g' and 'f' scopes. The guard made every 'a'/'t' search fail with "missing username" before issuing a request, breaking general search for all callers. The correctly scoped check inside the 'g','f' case already covers the case that needs it. Also run gofmt: the same cleanup introduced space indentation in deviantion.go, user-group.go, and util.go, which fails the gofmt CI step.
* Set package-ecosystem to 'gomod' in dependabot configChristian Cleberg2026-07-141-0/+11
|
* fix: bump codecov/codecov-action versionChristian Cleberg2026-07-141-1/+1
|
* fix: resolve golandci-lint errorsChristian Cleberg2026-07-144-20/+32
|
* feat: add support for building, testing, and publishing releasesChristian Cleberg2026-07-142-0/+101
|
* add Go actionsv0.3.0Christian Cleberg2026-07-141-0/+25
| | | add github actions to build and test
* clean up docsChristian Cleberg2026-07-142-11/+8
|
* format LICENSEChristian Cleberg2026-07-141-166/+529
|
* fix: resolve nil-deref crash, CSRF panic, add timeouts + clear CDN-block ↵Christian Cleberg2026-07-144-10/+179
| | | | | | errors; repoint module to zerolabsco References: https://github.com/zerolabsco/skunky-art/issues/2
* ошибкиlost+skunk2024-09-045-31/+46
|
* user favslost+skunk2024-08-143-16/+48
|
* Парсер медии с кастомным разрешениемv0.2.5lost+skunk2024-07-309-106/+105
|
* Небольшие допилыv0.2.0lost+skunk2024-07-132-1/+10
|
* Небольшие улучшения в группахlost+skunk2024-07-043-129/+166
|
* по мелочиlost+skunk2024-06-303-33/+36
|
* крымские наработкиlost+skunk2024-06-275-53/+75
|
* Daily Deviationslost+skunk2024-06-143-31/+41
|
* небольшие улучшенияlost+skunk2024-06-144-37/+57
|
* Update README.mdv0.1.0lost+skunk2024-06-051-2/+9
|
* User implementation and particaly groupslost+skunk2024-06-057-61/+152
|
* First Commit!lost+skunk2024-06-048-0/+434
|
* Initial commitlost+skunk2024-06-032-0/+238