structables 0.3.7__tar.gz → 0.3.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {structables-0.3.7 → structables-0.3.8}/PKG-INFO +1 -1
- structables-0.3.8/docker-compose-example.yml +18 -0
- {structables-0.3.7 → structables-0.3.8}/pyproject.toml +1 -1
- {structables-0.3.7 → structables-0.3.8}/src/structables/routes/member.py +32 -9
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/member-instructables.html +1 -1
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/member.html +1 -1
- {structables-0.3.7 → structables-0.3.8}/.env.example +0 -0
- {structables-0.3.7 → structables-0.3.8}/.forgejo/workflows/docker.yml +0 -0
- {structables-0.3.7 → structables-0.3.8}/.forgejo/workflows/release.yml +0 -0
- {structables-0.3.7 → structables-0.3.8}/.gitignore +0 -0
- {structables-0.3.7 → structables-0.3.8}/Dockerfile +0 -0
- {structables-0.3.7 → structables-0.3.8}/LICENSE +0 -0
- {structables-0.3.7 → structables-0.3.8}/README.md +0 -0
- {structables-0.3.7 → structables-0.3.8}/cronjob.txt +0 -0
- /structables-0.3.7/docker-compose-example.yml → /structables-0.3.8/docker-compose-example-dev.yml +0 -0
- {structables-0.3.7 → structables-0.3.8}/entrypoint.sh +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/__init__.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/config.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/main.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/routes/__init__.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/routes/category.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/routes/contest.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/routes/main.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/routes/proxy.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/static/css/style.css +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/static/img/logo.png +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/static/img/logo_lg.png +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/static/img/magnifying-glass-solid.svg +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/400.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/404.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/429.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/500.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/archives.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/article-review.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/article.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/base.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/category.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/collection.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/contest.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/contests.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/footer.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/header.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/iframe.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/index.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/privacypolicy.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/projects.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/sitemap.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/templates/style.html +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/utils/data.py +0 -0
- {structables-0.3.7 → structables-0.3.8}/src/structables/utils/helpers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: structables
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: A simple frontend for Instructables
|
|
5
5
|
Project-URL: Homepage, https://git.private.coffee/privatecoffee/structables
|
|
6
6
|
Project-URL: Bug Tracker, https://git.private.coffee/privatecoffee/structables/issues
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
services:
|
|
2
|
+
structables:
|
|
3
|
+
container_name: structables
|
|
4
|
+
restart: unless-stopped
|
|
5
|
+
image: privatecoffee/structables:latest
|
|
6
|
+
ports:
|
|
7
|
+
- "127.0.0.1:8002:8002"
|
|
8
|
+
env_file: .env
|
|
9
|
+
security_opt:
|
|
10
|
+
- no-new-privileges:true
|
|
11
|
+
cap_drop:
|
|
12
|
+
- ALL
|
|
13
|
+
read_only: true
|
|
14
|
+
deploy:
|
|
15
|
+
resources:
|
|
16
|
+
limits:
|
|
17
|
+
cpus: '0.5'
|
|
18
|
+
memory: 300M
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
from flask import render_template, abort
|
|
2
2
|
from urllib.request import urlopen
|
|
3
3
|
from urllib.error import HTTPError
|
|
4
|
+
from urllib.parse import quote
|
|
4
5
|
from ..utils.helpers import proxy, member_header
|
|
5
6
|
from bs4 import BeautifulSoup
|
|
6
7
|
from urllib.request import Request
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
def init_member_routes(app):
|
|
11
|
+
"""This function initializes all the routes related to Instructables member profiles.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
app (Flask): The Flask app instance.
|
|
15
|
+
"""
|
|
16
|
+
|
|
10
17
|
@app.route("/member/<member>/instructables/")
|
|
11
18
|
def route_member_instructables(member):
|
|
19
|
+
"""Route to display a member's Instructables.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
member (str): The member's username.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
Response: The rendered HTML page.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
member = quote(member)
|
|
29
|
+
|
|
12
30
|
try:
|
|
13
31
|
data = urlopen(
|
|
14
32
|
f"https://www.instructables.com/member/{member}/instructables/"
|
|
@@ -55,13 +73,18 @@ def init_member_routes(app):
|
|
|
55
73
|
|
|
56
74
|
@app.route("/member/<member>/")
|
|
57
75
|
def route_member(member):
|
|
58
|
-
|
|
59
|
-
"User-Agent": "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
|
|
60
|
-
}
|
|
76
|
+
"""Route to display a member's profile.
|
|
61
77
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
Args:
|
|
79
|
+
member (str): The member's username.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Response: The rendered HTML page.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
member = quote(member)
|
|
86
|
+
|
|
87
|
+
request = Request(f"https://www.instructables.com/member/{member}/")
|
|
65
88
|
|
|
66
89
|
try:
|
|
67
90
|
data = urlopen(request)
|
|
@@ -103,9 +126,9 @@ def init_member_routes(app):
|
|
|
103
126
|
"div.achievements-section.main-achievements.contest-achievements div.achievement-item:not(.two-column-filler)"
|
|
104
127
|
):
|
|
105
128
|
try:
|
|
106
|
-
ach_title = ach.select(
|
|
107
|
-
|
|
108
|
-
].text
|
|
129
|
+
ach_title = ach.select(
|
|
130
|
+
"div.achievement-info span.achievement-title"
|
|
131
|
+
)[0].text
|
|
109
132
|
ach_desc = ach.select(
|
|
110
133
|
"div.achievement-info span.achievement-description"
|
|
111
134
|
)[0].text
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<center>
|
|
5
5
|
<img width=150px height=150px style="display:inline-block;" src="{{ header_content.avatar }}" alt="{{ header_content.title }}">
|
|
6
6
|
<h1>{{ header_content.title }}</h1>
|
|
7
|
-
<span>{{ header_content.location }}  
|
|
7
|
+
<span>{% if header_content.location %}{{ header_content.location }} {% endif %}</span>
|
|
8
8
|
<span>{{ header_content.signup }}</span>
|
|
9
9
|
<br>
|
|
10
10
|
<span>{{ header_content.instructables }} Instructables </span>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<center>
|
|
5
5
|
<img width=150px height=150px style="display:inline-block;" src="{{ header_content.avatar }}" alt="{{ header_content.title }}">
|
|
6
6
|
<h1>{{ header_content.title }}</h1>
|
|
7
|
-
<span>{{ header_content.location }}  
|
|
7
|
+
<span>{% if header_content.location %}{{ header_content.location }} {% endif %}</span>
|
|
8
8
|
<span>{{ header_content.signup }}</span>
|
|
9
9
|
<br>
|
|
10
10
|
<span>{{ header_content.instructables }} Instructables </span>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/structables-0.3.7/docker-compose-example.yml → /structables-0.3.8/docker-compose-example-dev.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structables-0.3.7 → structables-0.3.8}/src/structables/static/img/magnifying-glass-solid.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|