0
test (lemmy.one)
submitted 2 years ago by [email protected] to c/[email protected]
8
submitted 2 years ago* (last edited 2 years 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

[-] [email protected] 1 points 2 years ago
[-] [email protected] 1 points 2 years ago

omg thank you! I never noticed it!

[-] [email protected] 5 points 2 years ago

I'd really like to see a "Unread" filter, that shows posts that has not already been up/downvoted or clicked

[-] [email protected] 3 points 2 years ago

Or just use an url shortener

[-] [email protected] 10 points 2 years ago

So we cannot screenshot it, clever... We need to document this and make sure everyone knows what reddit is doing. Perhaps screenshotting the post before posting it, making sure to include the permalink can be an idea to demonstrate their censorship

[-] [email protected] 4 points 2 years ago

Can you still see the text of the original post? I mean, the text containing the link to lemmy

[-] [email protected] 59 points 2 years ago

Ah, the free speech, how beautiful

[-] [email protected] 1 points 2 years ago

I use startpage, that returns the same results as google but keeping you private and with no annoying ads

[-] [email protected] 2 points 2 years ago

thanks for the super answer! I understand now!

4
submitted 2 years ago by [email protected] to c/[email protected]

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?

[-] [email protected] 1 points 2 years ago

Thanks! I'll share any news here on lemmy

[-] [email protected] 1 points 2 years 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)

[-] [email protected] 1 points 2 years ago

Yes I'll upload the code very soon!

Also it would be great if it could copy at least top-level comments by OP, because that's often used for linking to a source.

Great idea! Thanks!

0
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/[email protected]

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!

11
submitted 2 years ago by [email protected] to c/[email protected]
0
submitted 2 years ago by [email protected] to c/[email protected]
4
hehe (lemmy.one)
submitted 2 years ago by [email protected] to c/[email protected]
3
hehe (lemmy.one)
submitted 2 years ago by [email protected] to c/[email protected]
6
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/[email protected]
7
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/[email protected]
3
submitted 2 years ago by [email protected] to c/[email protected]
view more: next ›

tubbadu

0 post score
0 comment score
joined 2 years ago