Fediseer / fediseer

Something something stop bad instances
GNU Affero General Public License v3.0
51 stars 6 forks source link

Enhancement: Integration with The-Federation.info for Additional Spam Detection Metrics #2

Open AlphaPro06 opened 1 year ago

AlphaPro06 commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, this service uses the Lemmy Fediverse Observer to identify and counter bad actors. While this provides valuable insights, I believe the integration with additional data sources could further improve spam detection.

Describe the solution you'd like I suggest integrating with The-Federation.info. This service offers real-time data, including user count, active users, posts, and comments, for various federated social networks. The website also includes how many local posts and comments were made, giving a better picture as which instances are suspicious with high user counts but low local post and local comment count. Incorporating this data could enhance our understanding of the instance's activity and improve spam detection capabilities.

Describe alternatives you've considered Sticking with the current approach solely based on the Lemmy Fediverse Observer.

Additional context The integration with The-Federation.info could potentially provide another layer of information to detect suspicious activity quickly and more accurately.

AlphaPro06 commented 1 year ago

There is this spreadsheet I found as well that could useful and related to this issue

https://docs.google.com/spreadsheets/d/e/2PACX-1vRthB7RtY4Rr0t5fhVKaliJnwSmptMc5oJi7uha_OBcF4wpu4eElxAxNzaCqjlq6NsOE9GpgSnMzZ2x/pubhtml

db0 commented 1 year ago

Nice. Does it provide a REST API?

AlphaPro06 commented 1 year ago

I don't think it has a REST API but you use the following url using GraphiQL: https://the-federation.info/v1/graphql

That is where I think they're using to get the data. More info on that here

db0 commented 1 year ago

That graphql link you sent me doesn't seem to work. You mean this? https://the-federation.info/graphql

If so, I have no idea how to use it as it doesn't seem to have any guidance

unruffled3118 commented 1 year ago

You can use the link https://the-federation.info/graphql as a GUI version to write and run some test queries. For an example simple query format:

query { nodes { id, host }}

Will generate:

Screenshot 2023-06-23 185427

The schema is helpfully included to the right of the GUI in screen shot above so you can see all the available fields for your queries.

Once you have built your graphql query you can just CURL or fetch the API endpoint at https://the-federation.info/v1/graphql with your JSON encoded query. There's some simple examples here: https://www.apollographql.com/blog/graphql/examples/4-simple-ways-to-call-a-graphql-api/ of how to achieve this.

I'm not associated in any way with the-federation.info by the way, just thought it may be of some small help in understanding their API setup if you think it would be useful to pull data from.