Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Conos committed Jan 28, 2022
1 parent c52f3ab commit 7ab16c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
8 changes: 0 additions & 8 deletions Rock-API/api/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from flask import Flask, request
from flask_restful import Api, Resource, reqparse, abort, fields, marshal_with
from flask_sqlalchemy import SQLAlchemy
import uuid
import random

app = Flask(__name__)
Expand Down Expand Up @@ -63,13 +62,6 @@ def get(self, name):

@marshal_with(resource_fields)
def put(self, name):
with open('Rock-API/api/nsfw.txt') as file:
contents = file.read()
if name in contents:
abort(409, message="This contains NSFW words. Please try again.")
else:

pass
id = generate_id()
args = rock_put_args.parse_args()
result = RockMod.query.filter_by(name=name).first()
Expand Down
4 changes: 2 additions & 2 deletions Rock-API/tests/put.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@


# Base Ip
BASE = "http://127.0.0.1:5000/"
response = requests.put(BASE + "rock/" + "fuck", {"name": "fuck","desc":"we rock", "image": "none","rating": 1})
BASE = "https://mrconos.pythonanywhere.com/"
response = requests.put(BASE + "rock/" + "rock", {"name": "rock","desc":"Welcome to rock API where you can find rocks and rate them. This isn't what you think lol.", "image": "none","rating": 5})
print(response.json())
9 changes: 6 additions & 3 deletions readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@


### What is Rock API?
Rock API is an api that allows you to view rocks and get the ratings on them. I have a Discord bot which allows you to rate.
Rock API is an API that allows you to view rocks and find the ratings on them. However, this isn't a regular "rock finding" API... We have rocks like, `crunchy rock`, `moonrock`, and MANY more. This api we made for entertainment purposes. Use this API in your Discord bot for commands like `pls rock` or `!randomrock`. Use it in your website for... something.


### How do I use Rock API?

URL = `https://mrconos.pythonanywhere.com/rock/<rock name>` - Gives you a rock which returns a name, desc, image (link or none), and rating. The rating is supposed to be out of 5.
URL = `https://mrconos.pythonanywhere.com/rock/<rock name>` - Gives you a rock which returns a name, desc, image (link or none), and rating. The rating is supposed to be out of 5.

Random URL = `https://mrconos.pythonanywhere.com/rock/random` - Gives you a random rock from the API.

View the `tests` folder for more examples.


💁‍♂️ DM me on Discord at Conos#9079 if you have more questions. :)


*idk what im doing*

0 comments on commit 7ab16c3

Please sign in to comment.