<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.soylentnews.org/index.php?action=history&amp;feed=atom&amp;title=API_Example%3A_Python</id>
	<title>API Example: Python - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.soylentnews.org/index.php?action=history&amp;feed=atom&amp;title=API_Example%3A_Python"/>
	<link rel="alternate" type="text/html" href="https://wiki.soylentnews.org/index.php?title=API_Example:_Python&amp;action=history"/>
	<updated>2026-06-05T06:08:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.4</generator>
	<entry>
		<id>https://wiki.soylentnews.org/index.php?title=API_Example:_Python&amp;diff=56525&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;&lt;pre&gt; import requests  # URL and parameters for login login_url = 'https://dev.soylentnews.org/api.pl?m=auth&amp;op=login' login_payload = {     'nick': 'replic8tor',     'pass': 'apassword' }  # Post the JSON payload to the login URL response = requests.post(login_url, json=login_payload) print(response) # Check if the login request was successful if response.status_code == 200:     # Extract the cookie from the response     cookie = response.cookies.get_dict()     print(f'...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.soylentnews.org/index.php?title=API_Example:_Python&amp;diff=56525&amp;oldid=prev"/>
		<updated>2024-12-04T16:48:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; import requests  # URL and parameters for login login_url = &amp;#039;https://dev.soylentnews.org/api.pl?m=auth&amp;amp;op=login&amp;#039; login_payload = {     &amp;#039;nick&amp;#039;: &amp;#039;replic8tor&amp;#039;,     &amp;#039;pass&amp;#039;: &amp;#039;apassword&amp;#039; }  # Post the JSON payload to the login URL response = requests.post(login_url, json=login_payload) print(response) # Check if the login request was successful if response.status_code == 200:     # Extract the cookie from the response     cookie = response.cookies.get_dict()     print(f&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
import requests&lt;br /&gt;
&lt;br /&gt;
# URL and parameters for login&lt;br /&gt;
login_url = 'https://dev.soylentnews.org/api.pl?m=auth&amp;amp;op=login'&lt;br /&gt;
login_payload = {&lt;br /&gt;
    'nick': 'replic8tor',&lt;br /&gt;
    'pass': 'apassword'&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Post the JSON payload to the login URL&lt;br /&gt;
response = requests.post(login_url, json=login_payload)&lt;br /&gt;
print(response)&lt;br /&gt;
# Check if the login request was successful&lt;br /&gt;
if response.status_code == 200:&lt;br /&gt;
    # Extract the cookie from the response&lt;br /&gt;
    cookie = response.cookies.get_dict()&lt;br /&gt;
    print(f'Successfully logged in. Cookie: {cookie}')&lt;br /&gt;
    &lt;br /&gt;
    # URL and parameters for the subsequent API call&lt;br /&gt;
    subsequent_url = 'https://dev.soylentnews.org/api.pl'&lt;br /&gt;
    subsequent_params = {&lt;br /&gt;
        'redacts': '(?&amp;lt;=test of ).*?(?= This is only a)',&lt;br /&gt;
        'm': 'admin',&lt;br /&gt;
        'op': 'flag_spam',&lt;br /&gt;
        'cid': '31675',&lt;br /&gt;
        'spam_flag': '1',&lt;br /&gt;
        'mod_reason': 'test for jan'&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    # Make the subsequent API call with the cookie&lt;br /&gt;
    subsequent_response = requests.get(subsequent_url, params=subsequent_params, cookies=cookie)&lt;br /&gt;
    &lt;br /&gt;
    # Check if the subsequent request was successful&lt;br /&gt;
    if subsequent_response.status_code == 200:&lt;br /&gt;
        print('Successfully made subsequent API call.')&lt;br /&gt;
        print(subsequent_response.json())&lt;br /&gt;
    else:&lt;br /&gt;
        print(f'Failed to make subsequent API call. Status code: {subsequent_response.status_code}')&lt;br /&gt;
else:&lt;br /&gt;
    print(f'Failed to log in. Status code: {response.status_code}')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>