Our Southern cousins in Sydney and Melbourne have daily threads which encourages a bit of chatter… Where’s ours?

I’d love to be the change I wish to see in the world, but I have no idea how to automate this any better than an alarm on my phone saying “post a daily thread idiot” and I’m sure there’s a better way.

  • Rusty Raven
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Yes, there are a few teething errors but hopefully it will be automated soon. Pinning/unpinning the threads and any other fancy additions might be a fair bit longer, and it is likely to be a bit prone to glitches and failure especially when updates occur.

    Once it is running properly I can easily add in automatic posts for other communities, and it can do different types of posts and at different intervals. So I can do that (at request of moderator) or if you know how to use JavaScript to run a program there is code on Git Hub for a Lemmy Bot and Lemmy Frank Bot (which is to make regular posts, using the basic Lemmy Bot code).

    • deadcatM
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      I can investigate this. I’ve been a dev for many, many years. :)

    • deadcatM
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Ok, I’ve just written a script to call the Lemmy API and (hopefully) post the thread at 12:05am.

      I pulled the data I needed regarding properties and URLs from some test REST calls, then implemented a post bot using the official Lemmy HTTP client.

      and now we wait…

      • Rusty Raven
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Please Please Please tell me what you are doing, I am still having trouble with mine. The tests all worked fine but it won’t post past midnight, and so obviously won’t work on a recurring basis. Also the part that does the pinning is just crashing the whole thing at the moment and I had to take that section out.

        • deadcatM
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Oh… I better add pinning.

          I’m using a typescript app. I trigger it with a cronjob that runs a bash script wrapper.

          I should be able to put my code up on github this afternoon. :)

          • Rusty Raven
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            Are you able to tell me what app and how you actually run it? Having code is great, but no one seems able/willing to tell me what to actually do with the code. I have been running it in Visual Script on my laptop which works for a while but not for long. I’ve also been trying to use Vercel to run from their server, but I can only get it to run there in build mode (which is time limited) and not transfer it to an ongoing cron job.

            • deadcatM
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 year ago

              I’ve cleaned up my code and checked it in here: https://github.com/dfrencham/lemmy-post-bot

              I use Visual Studio code (I run it using the Linux subsystem for windows).

              I’ve put instructions in the README.md file, and cron setup instructions in the SETUP_CRON.md file.

              If you are not setup to build the bot, then I can create a built version and post a .tar.gz file for you to use.

              • Rusty Raven
                link
                fedilink
                English
                arrow-up
                2
                ·
                1 year ago

                Thank you, that is a lot simpler than the code I was using. Although I have miraculously got mine to work now, so will probably stick with that rather trying to redo it at this point, at least for now. It’s been a steep learning curve, but I am starting to somewhat understand what I am looking at with the code now, so that’s something!

                • calhoon2005
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  ·
                  1 year ago

                  I enjoyed this and it was very wholesome. Well done you two.

                • deadcatM
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  ·
                  1 year ago

                  Great to hear it is working :) always a great feeling.

                  I’ve updated my code to output a single .js file which can be called with node. The file is in a zip here: github

                  If you have a look at the code updates, you might find feature/unfeature code useful. :)