remotes/1693045480750635534/spooky-22
Aevann1 2021-10-06 11:03:39 +02:00
parent c89b314c05
commit a280418939
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)
options = []
for i in re.finditer('\s*\$([^\$\n]+)\$\s*', body):
for i in re.finditer('\s*\$$([^\$\n]+)\$$\s*', body):
options.append(i.group(1))
body = body.replace(i.group(0), "")

View File

@ -9,38 +9,50 @@
<pre></pre>
<pre></pre>
<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
* [Shadowbanned Users](/admin/shadowbanned)
* [Users with Agendaposter Theme](/admin/agendaposters)
* [Users Feed](/admin/users)
<h4>Content</h4>
<ul>
<li><a href="/admin/reported/posts">Reported Posts</a></li>
<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
* [Banned Domains](/admin/banned_domains)
* [Perceptive Hash Image Ban](/admin/image_ban)
* [Multi Vote Analysis](/admin/alt_votes)
<h4>Users</h4>
<ul>
<li><a href="/admin/shadowbanned">Shadowbanned Users</a></li>
<li><a href="/admin/agendaposters">Users with Agendaposter Theme</a></li>
<li><a href="/admin/users">Users Feed</a></li>
</ul>
#### Grant
* [Give User Award](/admin/user_award)
* [Badges](/admin/badge_grant)
<h4>Safety</h4>
<ul>
<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
* [Apps](/admin/apps)
<h4>Grant</h4>
<ul>
<li><a href="/admin/user_award">Give User Award</a></li>
<li><a href="/admin/badge_grant">Badges</a></li>
</ul>
#### Statistics
* [Content Stats](/stats)
* [Stat Chart](/chart)
<h4>API Access Control</h4>
<ul>
<li><a href="/admin/apps">Apps</a></li>
</ul>
#### Configuration
* [Site Rules](/admin/rules)
<h4>Statistics</h4>
<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">
<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>
{% filter markdown %}
# API Guide for Bots
<pre>
</pre>
This page explains how to obtain and use an access token.
## Step 1: Create your Application
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:
* an application name
* a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead).
* a brief description of what your bot is intended to do
Don't worry too much about accuracy; you will be able to change all of these later.
{{'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
<h1>API Guide for Bots</h1>
<pre></pre>
<p>This page explains how to obtain and use an access token. </p>
<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 an access token. You will need:</p>
<ul>
<li>an application name</li>
<li>a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead).</li>
<li>a brief description of what your bot is intended to do</li>
</ul>
<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>
<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>
<h2>Step 2: Using the Access Token</h2>
<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>
<pre> import requests
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)
print(r.json())
</pre>
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</p>
<pre>
@ -62,65 +45,38 @@ The expected result of this would be a large JSON representation of the posts po
</pre>
# API Guide for Applications
<pre>
</pre>
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.
This page explains how to obtain API application keys, how to prompt a user for authorization, and how to obtain and use access tokens.
## Step 1: Create your Application
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:
* an application name
* a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead).
* a brief description of what your application is intended to do
Don't worry too much about accuracy; you will be able to change all of these later.
{{'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.
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
<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>
<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>
<ul>
<li>an application name</li>
<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>
</ul>
<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 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>
<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>
<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>
<h2>Step 3: Catch the redirect</h2>
<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>
<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>
<pre> import requests
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)
print(r.json())
</pre>
The expected result of this would be a large JSON representation of the submissions submitted by @carpathianflorist
{% endfilter %}
<p>The expected result of this would be a large JSON representation of the submissions submitted by @carpathianflorist</p>
{% endblock %}

View File

@ -1336,8 +1336,6 @@ This only proves that I'm not MDEfugee, downie, autist, or any other labels you
{[para]}
Buy Bitcoin.
{[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 time to rise.