1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "messages": [{
9 "sender_username": "your_sender_username",
10 "sender_password": "your_password",
11 "recipient_username": "JohnHelpsStartups",
12 "message": "Hello from /user/JohnHelpsStartups/! Just trying out your Apify Ap! https://www.reddit.com/user/JohnHelpsStartups/",
13 }] }
14
15
16run = client.actor("johnvc/reddit-chat-dm-sender-sends-reddit-chats-to-users").call(run_input=run_input)
17
18
19print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
20for item in client.dataset(run["defaultDatasetId"]).iterate_items():
21 print(item)
22
23