This commit is contained in:
Aevann1 2021-10-06 11:03:39 +02:00
parent 4a365f8e41
commit 306bfd478d
4 changed files with 82 additions and 116 deletions

View file

@ -731,7 +731,7 @@ def submit_post(v):
body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body)
options = [] options = []
for i in re.finditer('\s*\$([^\$\n]+)\$\s*', body): for i in re.finditer('\s*\$$([^\$\n]+)\$$\s*', body):
options.append(i.group(1)) options.append(i.group(1))
body = body.replace(i.group(0), "") body = body.replace(i.group(0), "")

View file

@ -9,38 +9,50 @@
<pre></pre> <pre></pre>
<pre></pre> <pre></pre>
<h3>&nbsp;Admin Tools</h3> <h3>&nbsp;Admin Tools</h3>
{% filter markdown %}
#### Content
* [Reported Posts](/admin/reported/posts)
* [Reported Comments](/admin/reported/comments)
* [Image Posts](/admin/image_posts)
* [Removed Posts](/admin/removed)
#### Users <h4>Content</h4>
* [Shadowbanned Users](/admin/shadowbanned) <ul>
* [Users with Agendaposter Theme](/admin/agendaposters) <li><a href="/admin/reported/posts">Reported Posts</a></li>
* [Users Feed](/admin/users) <li><a href="/admin/reported/comments">Reported Comments</a></li>
<li><a href="/admin/image_posts">Image Posts</a></li>
<li><a href="/admin/removed">Removed Posts</a></li>
</ul>
#### Safety <h4>Users</h4>
* [Banned Domains](/admin/banned_domains) <ul>
* [Perceptive Hash Image Ban](/admin/image_ban) <li><a href="/admin/shadowbanned">Shadowbanned Users</a></li>
* [Multi Vote Analysis](/admin/alt_votes) <li><a href="/admin/agendaposters">Users with Agendaposter Theme</a></li>
<li><a href="/admin/users">Users Feed</a></li>
</ul>
#### Grant <h4>Safety</h4>
* [Give User Award](/admin/user_award) <ul>
* [Badges](/admin/badge_grant) <li><a href="/admin/banned_domains">Banned Domains</a></li>
<li><a href="/admin/image_ban">Perceptive Hash Image Ban</a></li>
<li><a href="/admin/alt_votes">Multi Vote Analysis</a></li>
</ul>
#### API Access Control <h4>Grant</h4>
* [Apps](/admin/apps) <ul>
<li><a href="/admin/user_award">Give User Award</a></li>
<li><a href="/admin/badge_grant">Badges</a></li>
</ul>
#### Statistics <h4>API Access Control</h4>
* [Content Stats](/stats) <ul>
* [Stat Chart](/chart) <li><a href="/admin/apps">Apps</a></li>
</ul>
#### Configuration <h4>Statistics</h4>
* [Site Rules](/admin/rules) <ul>
<li><a href="/stats">Content Stats</a></li>
<li><a href="/chart">Stat Chart</a></li>
</ul>
{% endfilter %} <h4>Configuration</h4>
<ul>
<li><a href="/admin/rules">Site Rules</a></li>
</ul>
<div class="custom-control custom-switch"> <div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="disablesignups" name="disablesignups" {% if x == "yes" %}checked{% endif %} onchange="post_toast('/admin/disablesignups');"> <input type="checkbox" class="custom-control-input" id="disablesignups" name="disablesignups" {% if x == "yes" %}checked{% endif %} onchange="post_toast('/admin/disablesignups');">

View file

@ -10,50 +10,33 @@
</pre> </pre>
{% filter markdown %} <h1>API Guide for Bots</h1>
# API Guide for Bots <pre></pre>
<p>This page explains how to obtain and use an access token. </p>
<pre> <h2>Step 1: Create your Application</h2>
</pre> <p>In the <a href="/settings/apps">apps tab of Drama settings</a>, fill in and submit the form to request an access token. You will need:</p>
<ul>
This page explains how to obtain and use an access token. <li>an application name</li>
<li>a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead).</li>
## Step 1: Create your Application <li>a brief description of what your bot is intended to do</li>
</ul>
In the [apps tab of {{'SITE_NAME' | app_config}} settings](/settings/apps), fill in and submit the form to request an access token. You will need: <p>Don't worry too much about accuracy; you will be able to change all of these later.</p>
<p>Drama administrators will review and approve or deny your request for an access token. You'll know when your request has been approved when you get a private message with an access token tied to your account.</p>
* an application name <p>DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret!</p>
* a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead). <h2>Step 2: Using the Access Token</h2>
* a brief description of what your bot is intended to do <p>To use the access token, include the following header in subsequent API requests to Drama: <code>Authorization: access_token_goes_here</code></p>
<p>Python example:</p>
Don't worry too much about accuracy; you will be able to change all of these later. <pre> import requests
{{'SITE_NAME' | app_config}} administrators will review and approve or deny your request for an access token. You'll know when your request has been approved when you get a private message with an access token tied to your account.
DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret!
## Step 2: Using the Access Token
To use the access token, include the following header in subsequent API requests to {{'SITE_NAME' | app_config}}: `Authorization: access_token_goes_here`
Python example:
<pre>
import requests
headers={"Authorization": "access_token_goes_here", "User-Agent": "sex"} headers={"Authorization": "access_token_goes_here", "User-Agent": "sex"}
url="{{request.host_url}}@carpathianflorist" url="https://rdrama.net/@carpathianflorist"
r=requests.get(url, headers=headers) r=requests.get(url, headers=headers)
print(r.json()) print(r.json())
</pre> </pre>
<p>The expected result of this would be a large JSON representation of the posts posted by @carpathianflorist</p>
The expected result of this would be a large JSON representation of the posts posted by @carpathianflorist
<pre> <pre>
@ -62,65 +45,38 @@ The expected result of this would be a large JSON representation of the posts po
</pre> </pre>
<h1>API Guide for Applications</h1>
<pre></pre>
<p>The OAuth2 authorization flow is used to enable users to authorize third-party applications to access their Drama account without having to provide their login information to the application.</p>
<p>This page explains how to obtain API application keys, how to prompt a user for authorization, and how to obtain and use access tokens. </p>
# API Guide for Applications <h2>Step 1: Create your Application</h2>
<p>In the <a href="/settings/apps">apps tab of Drama settings</a>, fill in and submit the form to request new API keys. You will need:</p>
<pre> <ul>
</pre> <li>an application name</li>
The OAuth2 authorization flow is used to enable users to authorize third-party applications to access their {{'SITE_NAME' | app_config}} account without having to provide their login information to the application. <li>a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead).</li>
<li>a brief description of what your application is intended to do</li>
This page explains how to obtain API application keys, how to prompt a user for authorization, and how to obtain and use access tokens. </ul>
<p>Don't worry too much about accuracy; you will be able to change all of these later.</p>
## Step 1: Create your Application <p>Drama administrators will review and approve or deny your request for API keys. You'll know when your request has been approved when you get a private message with an access token tied to your account.</p>
<p>DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret!</p>
In the [apps tab of {{'SITE_NAME' | app_config}} settings](/settings/apps), fill in and submit the form to request new API keys. You will need: <h2>Step 2: Prompt Your User for Authorization</h2>
<p>Send your user to <code>https://rdrama.net/authorize/?client_id=YOUR_CLIENT_ID</code></p>
* an application name <p>If done correctly, the user will see that your application wants to access their Drama account, and be prompted to approve or deny the request.</p>
* a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead). <h2>Step 3: Catch the redirect</h2>
* a brief description of what your application is intended to do <p>The user clicks "Authorize". Drama will redirect the user's browser to GET the designated redirect URI. The access token URL parameter will be included in the redirect, which your server should process.</p>
<h2>Step 4: Using the Access Token</h2>
Don't worry too much about accuracy; you will be able to change all of these later. <p>To use the access token, include the following header in subsequent API requests to Drama: <code>Authorization: access_token_goes_here</code></p>
<p>Python example:</p>
{{'SITE_NAME' | app_config}} administrators will review and approve or deny your request for API keys. You'll know when your request has been approved when you get a private message with an access token tied to your account. <pre> import requests
DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret!
## Step 2: Prompt Your User for Authorization
Send your user to `{{request.host_url}}authorize/?client_id=YOUR_CLIENT_ID`
If done correctly, the user will see that your application wants to access their {{'SITE_NAME' | app_config}} account, and be prompted to approve or deny the request.
## Step 3: Catch the redirect
The user clicks "Authorize". {{'SITE_NAME' | app_config}} will redirect the user's browser to GET the designated redirect URI. The access token URL parameter will be included in the redirect, which your server should process.
## Step 4: Using the Access Token
To use the access token, include the following header in subsequent API requests to {{'SITE_NAME' | app_config}}: `Authorization: access_token_goes_here`
Python example:
<pre>
import requests
headers={"Authorization": "access_token_goes_here", "User-Agent": "sex"} headers={"Authorization": "access_token_goes_here", "User-Agent": "sex"}
url="{{request.host_url}}@carpathianflorist" url="https://rdrama.net/@carpathianflorist"
r=requests.get(url, headers=headers) r=requests.get(url, headers=headers)
print(r.json()) print(r.json())
</pre> </pre>
<p>The expected result of this would be a large JSON representation of the submissions submitted by @carpathianflorist</p>
The expected result of this would be a large JSON representation of the submissions submitted by @carpathianflorist
{% endfilter %}
{% endblock %} {% endblock %}

View file

@ -1336,8 +1336,6 @@ This only proves that I'm not MDEfugee, downie, autist, or any other labels you
{[para]} {[para]}
Buy Bitcoin. Buy Bitcoin.
{[para]} {[para]}
I actually get so blackpilled when I realize most of you fags are depressed losers who most likely gravitated here because no one likes them and not because they actually have intellectual backing for their
{[para]}
It is not time to lay down nor look down. It is not time to lay down nor look down.
It is time to rise. It is time to rise.