[-] tubbadu@lemmy.one -1 points 1 year ago
1
submitted 1 year ago* (last edited 1 year ago) by tubbadu@lemmy.one to c/programming@beehaw.org

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

[-] tubbadu@lemmy.one 0 points 1 year ago
[-] tubbadu@lemmy.one 1 points 1 year ago

thanks for the super answer! I understand now!

0
submitted 1 year ago by tubbadu@lemmy.one to c/technology@beehaw.org

Hello fellow Lemmings! I hope this is the right place to ask this. I don't understand how web domains work. Let's say I want to buy the domain "abcdefghi.net". I can go to a domain provider like haruba or godaddy and just buy it. but how can they, a private, sell me these domains? I'm not talking about the hosting, but just the domain. where do they register this domain I'm buying? isn't it possible to register it myself instead of paying these services to do it for me?

[-] tubbadu@lemmy.one 0 points 1 year ago

Lmao perfect fit

[-] tubbadu@lemmy.one 1 points 1 year ago

Thanks! I'll share any news here on lemmy

[-] tubbadu@lemmy.one 1 points 1 year ago

I Read the terms of service and what I understood is that the intellectual property of the content is the users', not reddit's, but I asked on r/legaladvices for security (there is no equivalent community on lemmy yet)

[-] tubbadu@lemmy.one 1 points 1 year ago

Do you think this may be "dangerous" for me?

0
submitted 1 year ago* (last edited 1 year ago) by tubbadu@lemmy.one to c/lemmy@lemmy.ml

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!

8
submitted 1 year ago by tubbadu@lemmy.one to c/asklemmy@lemmy.ml
[-] tubbadu@lemmy.one 0 points 1 year ago

Not exactly :P

[-] tubbadu@lemmy.one 1 points 1 year ago

That you own your PC

4
hehe (lemmy.one)
submitted 1 year ago by tubbadu@lemmy.one to c/memes@lemmy.ml
1
hehe (lemmy.one)
4
submitted 1 year ago* (last edited 1 year ago) by tubbadu@lemmy.one to c/memes@lemmy.ml
2
submitted 1 year ago* (last edited 1 year ago) by tubbadu@lemmy.one to c/lotrmemes@midwest.social
3
submitted 1 year ago by tubbadu@lemmy.one to c/memes@lemmy.ml
view more: next ›

tubbadu

joined 1 year ago