this post was submitted on 13 Jul 2023
4 points (100.0% liked)

Beehaw Support

2794 readers
1 users here now

Support and meta community for Beehaw. Ask your questions about the community, technical issues, and other such things here.

A brief FAQ for lurkers and new users can be found here.

Our September 2024 financial update is here.

For a refresher on our philosophy, see also What is Beehaw?, The spirit of the rules, and Beehaw is a Community


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.


if you can see this, it's up  

founded 2 years ago
MODERATORS
 

I may be missing something obvious, but can you search for main url of a post? Trying avoid posting duplicate content. The search doesn't seem to check the url field for local or all search options.

top 3 comments
sorted by: hot top controversial new old
[–] Dankenstein@beehaw.org 3 points 1 year ago (1 children)

I'm not sure of any programs that will do this for you but Lemmy has a pretty nice API that you can use and there are libraries you can use for languages like JavaScript: https://github.com/LemmyNet/lemmy-js-client

import { LemmyHttp } from 'lemmy-js-client

const client = new LemmyHttp( 'https://beehaw.org/' )

const response = await client.search( {
	listing_type: 'Local',
	q: 'https://www.huckmag.com/article/sex-workers-and-the-kink-community-are-fighting-back-against-instagram-deplatforming',
	sort: 'TopNineMonths',
	type_: 'Url'
} )

console.log( response.posts.length ) // Should print '1' to the console
[–] irongamer@beehaw.org 3 points 1 year ago (1 children)

Ah, thanks. I should have given the API a look. I'll see if I can write something that will do what I need.

[–] ManyShapes@beehaw.org 2 points 1 year ago

If reading through all the JS and/or Rust is frustrating, theres programs to read it into easier to parse formats.