Commit Β·
adb0006
1
Parent(s): 3fb5618
Fix HF iframe bug and update UI docs
Browse files- Web_scrapper.py +34 -7
Web_scrapper.py
CHANGED
|
@@ -14,8 +14,8 @@ app = Flask(__name__)
|
|
| 14 |
# OWASP Security: Cross-Origin Resource Sharing
|
| 15 |
CORS(app)
|
| 16 |
|
| 17 |
-
# OWASP Security: HTTP Security Headers
|
| 18 |
-
Talisman(app, force_https=False, content_security_policy=None)
|
| 19 |
|
| 20 |
# OWASP Security: Rate Limiting (Prevent DDoS/Brute-force)
|
| 21 |
limiter = Limiter(
|
|
@@ -166,13 +166,40 @@ def index():
|
|
| 166 |
|
| 167 |
<h2>π Features</h2>
|
| 168 |
<ul>
|
| 169 |
-
<li><strong>
|
| 170 |
-
<li><strong>
|
| 171 |
-
<li><strong>AI & Indian Tech:</strong> Analytics India Magazine, Google AI, Android Dev.</li>
|
| 172 |
-
<li><strong>High Reliability:</strong> Uses robust feed-parsing instead of brittle web scrapers.</li>
|
| 173 |
<li><strong>Lightning Fast:</strong> Uses concurrent threading to fetch everything simultaneously.</li>
|
| 174 |
-
<li><strong>High-Quality Cover Images:</strong> OpenGraph fallback extraction.</li>
|
| 175 |
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
</div>
|
| 177 |
</body>
|
| 178 |
</html>
|
|
|
|
| 14 |
# OWASP Security: Cross-Origin Resource Sharing
|
| 15 |
CORS(app)
|
| 16 |
|
| 17 |
+
# OWASP Security: HTTP Security Headers (frame_options=None allows HuggingFace iframe embedding)
|
| 18 |
+
Talisman(app, force_https=False, content_security_policy=None, frame_options=None)
|
| 19 |
|
| 20 |
# OWASP Security: Rate Limiting (Prevent DDoS/Brute-force)
|
| 21 |
limiter = Limiter(
|
|
|
|
| 166 |
|
| 167 |
<h2>π Features</h2>
|
| 168 |
<ul>
|
| 169 |
+
<li><strong>Randomized Fresh Feed:</strong> Fetches top articles and shuffles them for a new experience on every reload.</li>
|
| 170 |
+
<li><strong>Strictly Coding News:</strong> Top developer communities and blogs only.</li>
|
|
|
|
|
|
|
| 171 |
<li><strong>Lightning Fast:</strong> Uses concurrent threading to fetch everything simultaneously.</li>
|
|
|
|
| 172 |
</ul>
|
| 173 |
+
|
| 174 |
+
<h2>π‘οΈ OWASP API Security Controls</h2>
|
| 175 |
+
<ul>
|
| 176 |
+
<li><strong>API Rate Limiting:</strong> 1000 requests/day globally, and strict 20 req/minute on <code>/news</code> to prevent DDoS and Scraping Abuse (OWASP API4:2023).</li>
|
| 177 |
+
<li><strong>CORS Protection:</strong> Safely configured Cross-Origin Resource Sharing.</li>
|
| 178 |
+
<li><strong>Security Headers:</strong> X-Content-Type-Options and other headers active to prevent MIME-sniffing and XSS attacks.</li>
|
| 179 |
+
</ul>
|
| 180 |
+
|
| 181 |
+
<h2>π API Documentation</h2>
|
| 182 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 183 |
+
<h3>Request</h3>
|
| 184 |
+
<div class="endpoint">GET /news</div>
|
| 185 |
+
|
| 186 |
+
<h3>Example Response (200 OK)</h3>
|
| 187 |
+
<pre style="background: #282c34; color: #abb2bf; padding: 15px; border-radius: 8px; overflow-x: auto;">
|
| 188 |
+
[
|
| 189 |
+
{
|
| 190 |
+
"title": "Building a fully local LLM App",
|
| 191 |
+
"url": "https://github.blog/2026-build-llm",
|
| 192 |
+
"image": "https://github.blog/wp-content/uploads/cover.png",
|
| 193 |
+
"source": "GitHub Blog"
|
| 194 |
+
},
|
| 195 |
+
{
|
| 196 |
+
"title": "Mastering CSS Grid in 2026",
|
| 197 |
+
"url": "https://css-tricks.com/mastering-grid",
|
| 198 |
+
"image": "https://css-tricks.com/grid-cover.jpg",
|
| 199 |
+
"source": "CSS-Tricks"
|
| 200 |
+
}
|
| 201 |
+
]</pre>
|
| 202 |
+
</div>
|
| 203 |
</div>
|
| 204 |
</body>
|
| 205 |
</html>
|