N
N
newsiberian2017-04-16 09:35:08
JavaScript
newsiberian, 2017-04-16 09:35:08

A web parser that recognizes possible insertions on any PL on any sites does anyone have an idea how to write?

Good afternoon, the task is to add an input to the site, which will accept absolutely any link and parse the source (presumably these can be articles with some kind of code examples, let's say from habr or medium, or just links to the code, or documents in google docs. That's all whatever.), the parser must recognize the PL that it encounters in order to further wrap this piece in highlighter.js and, in general, isolate the article itself / meaningful text from the link.
Does anyone have an idea how this could be done? The site is written in JS

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stalker_RED, 2017-04-16
@Stalker_RED

What is the YAP?

$a = 2;
$b = 3;
$c = $a + $b;
print($c);
print("\n");

If you thought it was PHP, then you guessed it .
Or not at all?

R
riot26, 2017-04-16
@riot26

A person will not always be able to recognize the JP. Accordingly, the answer is "no way".

N
newsiberian, 2017-04-16
@newsiberian

Here is an interesting article on the topic, but I'm completely off topic.
There was also an idea that to some extent you can use github-linguist

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question