<?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-11-07T08:53:01Z</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 = &#039;https://dev.soylentnews.org/api.pl?m=auth&amp;op=login&#039; login_payload = {     &#039;nick&#039;: &#039;replic8tor&#039;,     &#039;pass&#039;: &#039;apassword&#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&#039;...&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 = &amp;#039;https://dev.soylentnews.org/api.pl?m=auth&amp;amp;op=login&amp;#039;&lt;br /&gt;
login_payload = {&lt;br /&gt;
    &amp;#039;nick&amp;#039;: &amp;#039;replic8tor&amp;#039;,&lt;br /&gt;
    &amp;#039;pass&amp;#039;: &amp;#039;apassword&amp;#039;&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&amp;#039;Successfully logged in. Cookie: {cookie}&amp;#039;)&lt;br /&gt;
    &lt;br /&gt;
    # URL and parameters for the subsequent API call&lt;br /&gt;
    subsequent_url = &amp;#039;https://dev.soylentnews.org/api.pl&amp;#039;&lt;br /&gt;
    subsequent_params = {&lt;br /&gt;
        &amp;#039;redacts&amp;#039;: &amp;#039;(?&amp;lt;=test of ).*?(?= This is only a)&amp;#039;,&lt;br /&gt;
        &amp;#039;m&amp;#039;: &amp;#039;admin&amp;#039;,&lt;br /&gt;
        &amp;#039;op&amp;#039;: &amp;#039;flag_spam&amp;#039;,&lt;br /&gt;
        &amp;#039;cid&amp;#039;: &amp;#039;31675&amp;#039;,&lt;br /&gt;
        &amp;#039;spam_flag&amp;#039;: &amp;#039;1&amp;#039;,&lt;br /&gt;
        &amp;#039;mod_reason&amp;#039;: &amp;#039;test for jan&amp;#039;&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(&amp;#039;Successfully made subsequent API call.&amp;#039;)&lt;br /&gt;
        print(subsequent_response.json())&lt;br /&gt;
    else:&lt;br /&gt;
        print(f&amp;#039;Failed to make subsequent API call. Status code: {subsequent_response.status_code}&amp;#039;)&lt;br /&gt;
else:&lt;br /&gt;
    print(f&amp;#039;Failed to log in. Status code: {response.status_code}&amp;#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>