Comments (2)
Ich hab mal bissle rumprobiert wie man das ganze eventuell halbwegs formatiert bekommen könnte.
Hoffentlich kann damit jemand mit der Idee was anfangen und das einbauen...
Zum probieren einfach Copy+Paste in die JS Console
// Irgendwie halt an den Inhalt kommen
let textElement = document.getElementsByClassName('clearfix')[0].firstChild;
let text = textElement.innerHTML;
textElement.innerHTML = '';
// Wenn eine leerzeile mit zwei Leerzeichen beginnt handelt es sich um den selben Absatz
let regex = /\n /igm;
text = text.replace(regex, '');
// Jede Zeile ist jetzt ein Absatz oder eine Überschrift
let lines = text.split('\n');
for (let i = 0; i < lines.length; i++) {
let node = null;
// Kurz => Überschrift
if (lines[i].length < 50) {
node = document.createElement('h3');
}
else {
// Lange Überschriften haben hoffentlich kein Satzzeichen/Symbol
let lastChar = lines[i].charAt(lines[i].length - 1);
if (lastChar == '.' ||
lastChar == '?' ||
lastChar == '!' ||
lastChar == '«' ||
lastChar == ')'
) {
node = document.createElement('p');
}
else {
node = document.createElement('h3');
}
}
// HTML nach Spiegel nachbasteln
let wrapperDiv = document.createElement('div');
wrapperDiv.className = 'RichText RichText--iconLinks RichText--lastPmb0 RichText--lastInline lg:w-8/12 md:w-10/12 lg:mx-auto md:mx-auto lg:px-24 md:px-24 sm:px-16 clearfix break-words word-wrap';
let content = document.createTextNode(lines[i]);
node.appendChild(content);
wrapperDiv.appendChild(node);
textElement.appendChild(wrapperDiv);
}
from bibbot.
So, ich hab mal alle Seiten durchgetestet. Vorab: nur beim Spiegel treten die Fehler auf (bei magazin.spiegel.de nicht)
noz.de lädt kein einziger Payed Artikel bei ca. 10 getesteten
berliner-zeitung.de laden bei mir ohne alles, finde ich nichts payed
handelsblatt.com / wiwo.de nicht getestet, weil Adblockerhinweis nicht auszuschalten ging (mein Fehler, nichts vom Addon)
from bibbot.
Related Issues (20)
- Artikel nicht gefunden, offenes Tab zum Suchen automatisch geschlossen
- WELT+ Quelle → Ziel geht nicht
- Badische Landesbibliothek Karlsruhe und Stadtbibliothek Karlsruhe
- SZ Magazin Online Artikel nicht automatisch gefunden
- suedkurier.de
- Stadtbibliothek Nürnberg
- Württembergische Landesbibliothek
- Stadtbücherei Schweinfurt
- Ruhr Nachrichten
- KStA funktioniert nicht
- Tagesspiegel triggert nicht bibbot
- https://www.businessinsider.de/
- Neue Bibliothek: rlp.onleihe.de HOT 1
- Stadtbücherei Frankfurt bitte hinzufügen HOT 1
- Stadtbücherei Bamberg HOT 1
- Kieler Nachrichten Onine (bzw. Segeberger Zeitung)
- Liechtensteinische Landesbibliothek / Bibliothek Ostschweiz
- stern.de
- Android-Support (zB. über Kiwi Browser) HOT 6
- Zeitraum bei Wirtschaftswoche entfernen HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bibbot.