tubbadu

joined 1 year ago
 

@[email protected] hello let's try it

[–] [email protected] 1 points 1 year ago (1 children)

!haiku-bot unsubscribe

10
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Hello fellow Lemmings! I'm trying to develop a Lemmy bot that reads posts and comments using the lemmy-bot library. So I created a new Node.js project, installed the library, and wrote this:

import LemmyBot from 'lemmy-bot';

const LEMMY_USERNAME = process.env.LEMMY_USERNAME;
const LEMMY_PASSWORD = process.env.LEMMY_PASSWORD;
const LEMMY_INSTANCE = process.env.LEMMY_INSTANCE;

const bot = new LemmyBot.LemmyBot({
  // Pass configuration options here
  credentials: {
    username: LEMMY_USERNAME,
    password: LEMMY_PASSWORD
  },
  instance: LEMMY_INSTANCE,
  federation: "all",
  dbFile: 'db.sqlite3',
  handler: {
    comment: {
      handle: ({
        commentView: {
          comment: { creator_id, id }
        },
        botActions: { createComment }
      }) => {
        console.warn("new comment:")
      }
    },
    post: {
      handle: (x) => {
        console.warn("new post", x)
      }
    }
  }
});

bot.start()

and then I run it: node index.js
this is the output:

Connected to Lemmy Instance
Initializing DB
Logging in
Marking account as bot account
Subscribing to communities

and then stops there. I waited a lot and nothing, not a single log. credentials are correct, because otherwise it wouldn't login. the bot is using an account hosted on sh.itjust.work, so there should be plenty of activity (I tried adding comments manually but nothing was detected)

What am I doing wrong?

thanks in advance

 

the last time I remember I received a firefox notification it was using the native notification (i'm using KDE, I also have the KDE integration addon) yesterday I received a notification from lemmy, and this is how they appear, in the center of the screen and... very ugly. what changed? is there a way to get back the native notification?

(you can check how your notification works here)


EDIT: in about:config page, alerts.useSystemBackend is set to true, but still it does not use the native notification

 

I'm really curious about what's happening on Reddit during this user blackout, did r/spez made other bullshits?

 

Hello! I wrote a simple bot that periodically checks for new reddit posts and posts them to lemmy, so that people migrating from reddit to lemmy can still be able to see their favourite posts, but familiarizing with lemmy.

currently the coments are not synced, but this may change in the future (perhaps)

Yes, it uses the Reddit API, so it will stop working on the 1st of July, but I think that then I can implement a sort of web scraper to access Reddit posts without the official API, so this may eventually keep working for a while.

this script is currently on my laptop so it will be offline most of the time, but if I get the approval I may host it somewhere to get it running 24h/24.

now the question... Is this allowed? having this bot running 24h/24 on large subreddits will mean a very high quantity of posts. will this cause any problem to Lemmy?

if you want a preview check out https://enterprise.lemmy.ml/c/reddit_memes, where I started syncing a few posts from r/memes

let me know your opinion on this!

==== EDIT

here's the bot source code

The bot is now running in https://sh.itjust.works/c/reddit_memes, let's try to see if it work (I hope that shit just works)

I'm a bit concerned about the legality of this, if anyone has any info please tell me!

 

Hello guys! I'm looking for a cool wallpaper that matches my accent color #00D3B8
thanks in advance!

 
 
view more: next ›