Skip to content

(#413) Add 420chan support#518

Merged
Adamantcheese merged 37 commits into
Adamantcheese:multi-featurefrom
Lolzen:multi-feature
Feb 27, 2020
Merged

(#413) Add 420chan support#518
Adamantcheese merged 37 commits into
Adamantcheese:multi-featurefrom
Lolzen:multi-feature

Conversation

@Lolzen

@Lolzen Lolzen commented Jan 20, 2020

Copy link
Copy Markdown
  • SiteSetup
  • read threads/comments
  • thumbnails
  • posting
  • thread pinning
  • savedReply (You)s

current API doesn't make this easy, rather not possible in a reliable way.

  • reply/image count

tried to circumvent the missing API key by manually counting images and passing the value to builder.images, but it either reset on every occourance or added up and didn't reset the counter at all
may research and retry at a later point. replies key is present in threadview mode.

  • sage
  • reporting

current implementaion is limited and straight forward. Contrary to 4chan's report, there's no seperate url/window we can use. Therefore the options (reason & note) are predetermined.

  • review text formatting

should be almost complete. However due to the weird symbiosis by modifying the comments in TaimabaApi and then adding rulesets in TaimabaCommentParser this wil lead to issues and is more a long term process of catching and perfecting all cases
maybe going the similar route which dvach's implementation of extending the PostParser is a better approach. Will look into that, but for now it's good enough.

  • when a thread 404s it returns an API parse error instead of the 404 message

absolutely no idea
https://abload.de/img/screenshot_matlog_202onk2b.png
https://api.420chan.org/b/res/4952702.json

@K1rakishou K1rakishou left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor things.

@Lolzen

Lolzen commented Jan 20, 2020

Copy link
Copy Markdown
Author

So, i'm pretty much where i was before except by commenting out defaultRules in TaimabaCommentParser strikethrough is not considered a spoiler. The necessary changes made to TaimabaApi were ripped off from Overchan. That's kinda why i didn't include these in the first place, because now the problem is that whatever i've tried i couldn't manage to properly implement inlinequoting (always weird results when it worked, like ALL text or only the last inline quote colored) and quoting (was linkified but clicking on it had no result).

I'll be focusing on trying to get posting going even though i'll probably need a lot of time.

still throws an error, don't know how to proceed further
*use defaultrules (for quotes to work)
*rename tagrule "s" to "strike" to prevent colliding with defaultrule for spoilers
*use correct quote patterns
*remove comments/cleanup
throws an onPostComplete error, but the post arrives
@Lolzen

Lolzen commented Jan 27, 2020

Copy link
Copy Markdown
Author

Posting does work, but throws an onPostComplete error, unsure why. Probably because replyResponse.posted is not true.
I noticed that on Kuroba the inline-quote formatting fucks up reply-quotes (clickable but deformed)
The pattern used should be more precise, but i can't construct a correct one.

These are the two issues i see as of now.

@Lolzen Lolzen changed the title [WiP] [DNM] Add rudimentary 420chan support [WiP] Add 420chan support Jan 27, 2020
@Adamantcheese

Copy link
Copy Markdown
Owner

In your Actions class, there's a handlePost method that takes care of setting replyResponse.posted. You may need to adjust the regex inside that method for it to properly set that, so you can do what Wired7 did, which is copy the method and change the regex. The site itself seems to redirect to the board homepage, which is stupid, but will probably make your life more difficult for determining what thread number and post number the reply response is associated with, since those are being parsed from the request URL.

@Lolzen

Lolzen commented Jan 29, 2020

Copy link
Copy Markdown
Author

Yep figured that much out, but i couldn't really figure out the correct pattern. However after i read that the site redirects you to the board overview anyways i figured i try a hacky method of just storing the threadNo, postNo & password from reply values of the setupPost method and use them directly.
Feels pretty hacky, and i don't think it's the correct way to handle things but at least it works without throwing an error now. Anyways the next problem is that your own replies won't be saved, meaning no highlighting and no (You)s consequently. I've looked at onPostComplete in ReplyPresenter and it seems it should be fetched from loadable, as the other values are now passed. Thread pinning does work.

I'll commit the way it is now for review, but i'll keep tinkering around and revert/update once i get the proposed way working.

There also are a lot of minor issues which need to be taken care of/worked around (reply/image count, when posting with an image the file size is a negative value and triggers the warnign "file size too big" (but posts correctly), sage doesn't work) I may find some more, but these are on the todo list for now.

EDIT: correct errorPattern is now used and errors show up correctly.
As said before the redirect doesn't allow us to fetch the postNo from the url, so this needs to somehow be available or made available and used afterwards.

@Lolzen

Lolzen commented Feb 3, 2020

Copy link
Copy Markdown
Author

moved comment to first comment

limitations:
*the webview isn't helpful other than confirming the report has been sent
*the reason will always be "RULE_VIOLATION", never "ILLEGAL_CONTENT"
*the (supposed to be helpful and descriptive text) will always be "Kuroba generated report")
@Lolzen Lolzen changed the title [WiP] Add 420chan support (#413) Add 420chan support Feb 20, 2020
@Adamantcheese Adamantcheese merged commit cec0ff6 into Adamantcheese:multi-feature Feb 27, 2020
@Adamantcheese Adamantcheese mentioned this pull request Jun 10, 2020
Lolzen added a commit to Lolzen/Clover that referenced this pull request Aug 4, 2020
based on the initial implementation in Kuroba
see Adamantcheese#518
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants