Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aichecker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Eggers
aichecker
Commits
d79795de
Commit
d79795de
authored
4 months ago
by
Jan Eggers
Browse files
Options
Downloads
Patches
Plain Diff
akt
parent
d29b9d08
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+7
-0
7 additions, 0 deletions
README.md
read_posts.py
+28
-7
28 additions, 7 deletions
read_posts.py
with
35 additions
and
7 deletions
README.md
+
7
−
0
View file @
d79795de
# aichecker
# aichecker
Checks Bluesky accounts (and, later, similar media) for AI suspicion.
Checks Bluesky accounts (and, later, similar media) for AI suspicion.
## Wozu es gut ist
Das Fernziel ist eine Recherche zu KI-Inhalten im Wahlkampf mit zwei Stoßrichtungen:
-
Verdachtsfälle besonders krasser Fälschungen finden
-
Gesamt-KI-Anteil nach Partei/Person
## Der Plan
## Der Plan
### Phase 1: Bluesky
### Phase 1: Bluesky
...
...
This diff is collapsed.
Click to expand it.
read_posts.py
+
28
−
7
View file @
d79795de
...
@@ -4,11 +4,11 @@ from atproto import Client, models
...
@@ -4,11 +4,11 @@ from atproto import Client, models
def
fetch_user_posts
(
handle
:
str
,
limit
:
int
=
100
)
->
list
:
def
fetch_user_posts
(
handle
:
str
,
limit
:
int
=
100
)
->
list
:
# Initialize the Bluesky client (unauthenticated)
# Initialize the Bluesky client (unauthenticated)
client
=
Client
()
client
=
Client
(
base_url
=
"
https://api.bsky.app
"
)
try
:
try
:
# Fetch the user ID from the handle
# Fetch the user ID from the handle
profile
=
client
.
get_profile
(
handle
)
profile
=
client
.
app
.
bsky
.
actor
.
get_profile
(
{
'
actor
'
:
handle
}
)
user_id
=
profile
.
did
user_id
=
profile
.
did
# Initialize an empty list to store posts
# Initialize an empty list to store posts
...
@@ -17,11 +17,31 @@ def fetch_user_posts(handle: str, limit: int = 100) -> list:
...
@@ -17,11 +17,31 @@ def fetch_user_posts(handle: str, limit: int = 100) -> list:
# Fetch timeline for the user (latest posts first)
# Fetch timeline for the user (latest posts first)
cursor
=
None
cursor
=
None
while
len
(
posts
)
<
limit
:
while
len
(
posts
)
<
limit
:
feed
=
client
.
app
.
bsky
.
feed
.
get_author_feed
(
actor
=
user_id
,
limit
=
min
(
limit
-
len
(
posts
),
50
),
cursor
=
cursor
)
feed
=
client
.
app
.
bsky
.
feed
.
get_author_feed
({
'
actor
'
:
user_id
,
if
not
feed
.
posts
:
'
limit
'
:
min
(
limit
-
len
(
posts
),
50
),
'
cursor
'
:
cursor
,
})
if
not
feed
[
'
feed
'
]:
break
break
posts
.
extend
(
feed
.
posts
)
for
item
in
feed
[
'
feed
'
]:
cursor
=
feed
.
cursor
# Extract basic post information
post_data
=
{
'
author_handle
'
:
getattr
(
item
[
0
][
1
],
'
handle
'
,
''
),
'
author_display_name
'
:
getattr
(
item
[
0
][
1
],
'
display_name
'
,
''
),
'
author_did
'
:
getattr
(
item
[
0
][
1
],
'
did
'
,
''
),
'
created_at
'
:
getattr
(
item
[
3
],
'
created_at
'
,
''
),
'
indexed_at
'
:
item
[
2
],
'
text
'
:
getattr
(
item
[
3
],
'
text
'
,
''
),
'
uri
'
:
item
[
4
],
'
cid
'
:
item
[
1
],
'
like_count
'
:
item
[
8
],
'
reply_count
'
:
item
[
10
],
'
repost_count
'
:
item
[
11
],
'
quote_count
'
:
item
[
9
],
'
language
'
:
getattr
(
item
[
3
],
'
langs
'
,
[
''
])[
0
]
if
hasattr
(
item
[
3
],
'
langs
'
)
else
''
}
posts
.
append
(
post_data
)
cursor
=
len
(
feed
[
'
feed
'
])
return
posts
[:
limit
]
return
posts
[:
limit
]
...
@@ -31,7 +51,8 @@ def fetch_user_posts(handle: str, limit: int = 100) -> list:
...
@@ -31,7 +51,8 @@ def fetch_user_posts(handle: str, limit: int = 100) -> list:
def
main
():
def
main
():
# Define the Bluesky handle and number of posts to fetch
# Define the Bluesky handle and number of posts to fetch
handle
=
'
@lion-c.bsky.social
'
# Replace with the desired handle
# Remove the @ before handle strings
handle
=
'
lion-c.bsky.social
'
# Replace with the desired handle
limit
=
100
limit
=
100
# Fetch the last 100 posts from the specified user
# Fetch the last 100 posts from the specified user
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment