I'm new here, what's wrong with Discourse?



  • Easy solution:

    Create an 'Archive' category
    Direct link it to old forums

    Done.



  • @aliceif said:

    Discourse isn't any car. It's a Toyota Prius which has been haphazardly modified to have the power of a truck. (I think that's what someone in one of the grumpy cat threads said).

    Is that why the car's frame keeps getting twisted up so it crashes?


  • :belt_onion:

    @HardwareGeek said:

    You've already seen them in action. I'll let one of the bot developers address the question of the genesis.

    Technically the first bot would have been liker-bot, by @chaostheeternal among others, but I don't know if it was counted because it just liked under your account, no posting.

    As for bots that posted, there were two separate comings. The original genesis was jeff's post a while back that it was simply too hard to write a bot to interact with their incredibly difficult to understand codebase, so i (and a couple others I think) made a simple shitty javascript one that posted spam to prove a point. Then there was maybe a month or more with bot silence, presumably because no one cared.

    I don't know what spurred the 2nd bot revolution, but at this point at least 3 or 4 of us have independently created our own various bots that do different things.



  • @blakeyrat said:

    The road of Discourse only works for sports cars, no pickup trucks are allowed

    What about the Holden HSV Maloo? It's both sports car (at least, under the hood) and pickup truck ute



  • It definitely wasn't me asking for an auto poster prompting @accalia to make sockbot




  • Discourse touched me in a no-no place

    @aliceif said:

    Discourse isn't any car. It's a Toyota Prius which has been haphazardly modified to have the power of a truck. (I think that's what someone in one of the grumpy cat threads said).

    It's also had the suspension lowered so that base of the frame is only micrometers above the road surface. Taking it over an uneven surface like the brow of a hill is Doing It Wrong™…



  • @darkmatter said:

    Technically the first bot would have been liker-bot

    Wasn't really a bot so much, it was a script that required a browser tab logged in to do its work. Didn't interact with the message bus or anything like the current bots do, just fired the click event for unliked posts and scrolled down every once in awhile to keep going.


  • :belt_onion:

    My reading-replying-liking bot also uses a logged in tab to navigate the built-in UI in a similar manner. It just has a bit more logic about how it goes about doing the task than triggering every button and scrolling. Except for replying, it replies by submitting a direct post to the website rather than bothering with the UI overhead involved there.


  • FoxDev

    @Matches said:

    It definitely wasn't me asking for an auto poster prompting @accalia to make sockbot

    I'm pretty much writing sockbot because i can. I find it an interesting project, and i'm trying to make him as painless as possible.

    When i alter him for @TCtoCDCK bot he'll be significantly more annoying, but he will also shutdown and or mute for a period of time when PMed and told to by anyone that is: a mod, an admin, TL4, or in the programmers testing group.

    but yeah, it's mostly because i can and Jeff said it couldn't be done (yes, others had done it by the point i started, whatever i wanted my own.



  • I'll be doing MarvinBot with that in mind, too, and I don't mind admitting that I'll be looking at the other bots - because I'm going to have enough to be doing with writing mine in PHP as a daemon, for me that's where the real fun will lie.


  • FoxDev

    this, also why i'm doing it in node.js

    i plan on making it work in a browser too.



  • Yeah but I don't really want to have to install Node.js on my VPS and I'm much much more comfortable with PHP than I am with Node.js, to the point where I'd rather create a thoroughly compounded - but intentional - level of WTF than be accidentally WTFfy with Node.


  • FoxDev

    and there's nothing wrong with that.

    i plan on making @sockbot WTFy enough anyway, but i'm not touching go like @ben_lubot


  • FoxDev

    hmm... sockbot appears to have crashed. it was supposed to be summoned by that.

    razzum frazzum....



  • That thing ain't never gonna happen.



  • @SignatureGuy was the first I was aware of, and all my bots are forks of him. Mostly I did it for the lulz, converting SignatureGuy into MarkovBot was a fun little project and temporarily alleviated some boredom. Then once MarkovBot got boring I had to go one step further and bring in Cleverbot.

    @darkmatter said:

    The original genesis was jeff's post a while back that it was simply too hard to write a bot to interact with their incredibly difficult to understand codebase

    And this is further proof that JDGI, and partially why I got involved. Writing bots for Discourse is much simpler than writing bots for traditional forums! Like an order of magnitude easier since you don't have to do HTML scraping to figure out who posted what, where, and when. You just plug into the REST API that the Discourse JavaScript code uses, and talking to a REST API is (in the words of a famous TDWTFer) stupid simple!

    Anything Jeff says seems to be two or three layers removed from reality. He's involved with Discourse, but not enough to really know what it is or how it works. He's watching an ant farm from orbit. TDWTF likes to play whack-a-mole with his ridiculous claims and self-referential research, and far too often it's an easy game to play.

    If he hadn't made the claim that "bots are impossible" I doubt much would have happened past @SignatureGuy, in the same way that claiming "Likes can be abused and so they must be rate-limited" led to the genesis of the Likes thread. We take statements like that as a challenge around here.



  • I agree with whatever @mott555 posted just above.<t3524p67>





  • @mott555 said:

    You just plug into the REST API that the Discourse JavaScript code uses, and talking to a REST API is (in the words of a famous TDWTFer) stupid simple!

    I have written an elaborate reply to that, but Discourse ate my draft, so I'll just tell this: Discourse's REST API is very barely an API. It's more like they just go "oh, we need this piece of data on the front-end... we'll stick it in... *closes eyes and points at the codebase*... this object!"

    Say, you want to view all posts in the topic, in their raw form - that's pretty much the perfect use case for a REST API. You can't do this.

    You can either go through posts.json, which either gets you one post, or several ones - but to get several, you need to issue the following request (nb. taken from my network tab - that's what Discourse does when you scroll down):

    http://what.thedailywtf.com/t/3125/posts.json?post_ids%5B%5D=79306&post_ids%5B%5D=79309&post_ids%5B%5D=79311&post_ids%5B%5D=79314&post_ids%5B%5D=79317&post_ids%5B%5D=79318&post_ids%5B%5D=79329&post_ids%5B%5D=79332&post_ids%5B%5D=79334&post_ids%5B%5D=79336&post_ids%5B%5D=79340&post_ids%5B%5D=79341&post_ids%5B%5D=79346&post_ids%5B%5D=79348&post_ids%5B%5D=79355&post_ids%5B%5D=79362&post_ids%5B%5D=79363&post_ids%5B%5D=79366&post_ids%5B%5D=79374&post_ids%5B%5D=79377&post_ids%5B%5D=79378&post_ids%5B%5D=79379&post_ids%5B%5D=79381&post_ids%5B%5D=79386&post_ids%5B%5D=79387&post_ids%5B%5D=79393&post_ids%5B%5D=79395&post_ids%5B%5D=79500&post_ids%5B%5D=79561&post_ids%5B%5D=79565&post_ids%5B%5D=79617&post_ids%5B%5D=79618&post_ids%5B%5D=79619&post_ids%5B%5D=79620&post_ids%5B%5D=79621&post_ids%5B%5D=79673&post_ids%5B%5D=79675&post_ids%5B%5D=79686&post_ids%5B%5D=79690&post_ids%5B%5D=79692&post_ids%5B%5D=79694&post_ids%5B%5D=79695&post_ids%5B%5D=79698&post_ids%5B%5D=79700&post_ids%5B%5D=79701&post_ids%5B%5D=79704&post_ids%5B%5D=79705&post_ids%5B%5D=79710&post_ids%5B%5D=79711&post_ids%5B%5D=79714&_=1412100098201
    

    And, obviously, you need those (global) post IDs first - if the post with a given ID is not in the thread, it simply won't be returned. And you still can't get all posts in thread, because you'll run into REQUEST_TOO_LONG about 200 posts in.

    You can also get posts via /t/{topic}/{post}.json, but that gives you an array of 50 posts, with some above, some below, and the one you need stuck in the middle.

    And, of course, neither of those methods gives you the raw view, only cooked - which basically means that you have to issue yet another request to /t/raw for each of those posts if you want both the raw post and the post author.

    And that's not even going into what appears on the message bus, which is basically "whatever we need, and nothing more for you".



  • That seems unnecessarily complicated. MarkovBot fetches posts like this: http://what.thedailywtf.com/user_actions.json?offset=0&username=mott555&filter=5

    Uses a counter to track how many have been retrieved and increments it by the post count for each request, then requests again with the offset updated.

    Full source:

    def _get_posts(self, username):
        getMorePosts = True
        offset = 0
        posts = []
        while getMorePosts:
            json = self._get("/user_actions.json", offset=offset, username=username, filter=5, _=int(time() * 1000))
            actions = json[u'user_actions']
            print "Loaded %d posts from offset %d" % (len(actions), offset)
            if len(actions) > 0:
                for post in actions:
                    posts.append(post[u'excerpt'])
                offset = len(posts)
            else:
                getMorePosts = False
        return posts
    

    And despite the post content being stored in something called "excerpt", in practice it seems to always contain the entire post.



  • @mott555 said:

    That seems unnecessarily complicated. MarkovBot fetches posts like this: http://what.thedailywtf.com/user_actions.json?offset=0&username=mott555&filter=5

    Oh for fuck's sake, they can do it per-user, but can't do it per-thread?



  • Not sure, I haven't investigated how thread loading works. MarkovBot is only interested in a single user's posts.



  • Nevermind, you only get last 60 posts anyway.

    The point is, it's not an API in that it's not really intended to be usable by anything other than Discourse front-end. Guess they don't really give a crap about plugin developers...


  • Discourse touched me in a no-no place

    @Maciejasjmj said:

    but that gives you an array of 50 posts

    Related, I think, to the following setting which defaults to 20. I changed it a few days ago.

    I mention this, because it's not guaranteed to remain 50...



  • Posts per page

    o.O

    @PJH said:

    I mention this, because it's not guaranteed to remain 50...

    So, it gives you "some amount of posts, with the one you specified somewhere in the middle". Oh, amazing.


  • :belt_onion:

    My hope is that the CS import causes everyone to lose TL3 thanks to lack of reading.



  • @PJH said:

    Related, I think, to the following setting which defaults to 20. I changed it a few days ago.

    I mention this, because it's not guaranteed to remain 50...

    I wonder if there is a upper limit to this value… My guess would be that there isn’t, and if you set it to 200, long topics will become unaccessible (because the server will start replying REQUEST_TOO_LONG, as @Maciejasjmj said)

    Anyway, those long requests probably do not improve load times on slow connections (AFAIK GET request data is never compressed)



  • I think the forum would be much more pleasant to read at say, 100 posts per page... Though the question would be 'How long would discourse take to load 100 posts'

    that way you have a decent amount to read before you get another fucking loading screen and most (new) threads would be loaded entirely.


  • Discourse touched me in a no-no place

    The problem is, as already noted, if you go to a long thread (/t/1000 for example) it will load ~½ the number of posts before the one you're arriving at... (rather than, say, 1/10 with 9/10 after your landing post) putting more load on the server (which is why, I presume, 20 was chosen as a small default...)



  • Something something, 80/20 rule, something something. <z 20% back, 80% forward>


  • Discourse touched me in a no-no place

    80% of everything is crap, so is the other 20%? 👿



  • @Matches said:

    Something something, 80/20 rule, something something. <z 20% back, 80% forward>

     



  • What about prefetching 20 more posts during scrolling? Would that make too much sense?
    (Maybe not displaying them, but at least start loading them…)



  • Obviously it would, but the loading bar is a barrier to reading, and jeff is barrier man.

    Think about it like this:

    Set target = 100

    Load up to 10% backwards post from drop in point
    Load the 90% forward posts from drop in point

    As you reach 75% begin prefetching the next set of target count

    If you want to set aggressive pre-fetching (IE: your target is smaller) begin at 50% scroll.

    If you are scrolling UP (IE: Backward) load up to 90% in that direction.


  • Discourse touched me in a no-no place

    @VinDuv said:

    Would that make too much sense?

    Which is why it probably doesn't happen....


  • :belt_onion:

    @VinDuv said:

    What about prefetching 20 more posts during scrolling? Would that make too much sense?

    that's only how everyone else's infiniscroll implementation works, why would you do that when you can re-invent the wheel, but square.



  • say this on the image was (and still is) awesome.



  • I mean one uses to the changes:

    1. The "in reply in many ways a proper spec is a bit of forward, back button. That is no longer allowed.


  • No quack?



  • There was a conversation back in the early days that went something like this:
    TDWTF: I found this documentation for writing plug-ins.
    DiscoDev: Don't use that. It's out of date. The API has changed a lot since then.
    TDWTF: Where's the updated documentation?
    DiscoDev: There isn't any.

    @Maciejasjmj said:

    they don't really give a crap about plugin developers

    Pretty much.


  • FoxDev

    FWIW:

    message_bus returns messages in the format for /topic/ channels:

    { global_id: 132440,
      message_id: 2300,
      channel: '/topic/1000',
      data: 
       { id: 119990,
         post_number: 24355,
         updated_at: '2014-10-15 00:12:13 +0000',
         type: 'acted' } }
    

    it appears that messsage.data.id === post id

    so @Maciejasjmj .... it looks like you have the data you wanted here.

    cheers!

    also, woo! necroposting!



  • @accalia said:

    FWIW:

    message_bus returns messages in the format for /topic/ channels:

    { global_id: 132440,
      message_id: 2300,
      channel: '/topic/1000',
      data: 
       { id: 119990,
         post_number: 24355,
         updated_at: '2014-10-15 00:12:13 +0000',
         type: 'acted' } }
    

    it appears that messsage.data.id === post id

    so @Maciejasjmj .... it looks like you have the data you wanted here.

    cheers!

    also, woo! necroposting!

    It looks like you have a snake in there.


Log in to reply