Timidger / autowikiabot-py

Reddit bot that replies to comments with excerpt from linked wikia article or section.
Other
9 stars 1 forks source link

The wikipedia bot uses an on-hover feature. It would be great if this did too #9

Closed FichteFoll closed 10 years ago

FichteFoll commented 10 years ago

You've probably seen a post by the wikipedia bot before, where you need to hover the text in order to make it show contents. I don't have an example link right now.

Since the text this bots extracts are quite large at times, this would be really useful for this bot too.

Timidger commented 10 years ago

As of right now, the format is close enough to autowikibot that any subreddits that auto-hide autowikiabot. I don't know any CSS, but I found the link that talks about the code required for a subreddit to hide posts. I'll be happy to change autowikiabot's format, but I don't enough CSS to be able to reflect that for the subreddits.

FichteFoll commented 10 years ago

I analyzed the html and comment source from the first example wikibot post (thanks RES) and it looks like you only have to include the following at the beginning of your comment:

#####	

######	

####	

(this is h5 h6 h4 respectively, containing a tab character, and then followed by your actual code text in an implicit <p> tag)

FichteFoll commented 10 years ago

Also note that it only hides the following elements if they appear in this exact order:

You may omit all elements after a certain point (for example the last p) but you may not remove the hr in the middle and then continue with p blocks. These will not be hidden otherwise.

Edit: Looks like it's working http://www.reddit.com/r/leagueoflegends/user/autowikiabot

I'm sure it didn't before. Or maybe it was because I was viewing the message on http://www.reddit.com/message/ ? But I seem to remember that I actually clicked the permalink and it didn't work there.

Timidger commented 10 years ago

The problem is, that some sub-reddits have CSS to look for that exact string for autowikibot, so when autowikiabot posts with that exact same header, it's hidden (but with text saying it's hiding an autowikibot post). So we'd have to make a similarly hidden header so as not to conflict with autowikibot's

FichteFoll commented 10 years ago

Oh well, i don't have a problem with that. My problem was that the autowikiabot pots didn't seem to be hidden while the wikibot posts did. Anyway, since that has been resolved (even though I don't know why or how), I'll close the issue.