M
M
MadWastefield2018-01-09 09:55:23
PHP
MadWastefield, 2018-01-09 09:55:23

How to highlight the right words in any application?

Are there any applications for highlighting given words on the screen, regardless of the application in which they occur?
I met a program for copying text or contextual translation from any application, so I thought - maybe there is one too.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
nokimaro, 2019-10-29
@nokimaro

Perhaps the site looks for the presence of certain HTTP headers, for example, for a non-empty user-agent or some other headers.
To set them, curl is not necessarily needed (but I recommend it), you can do this for file_get_contents as well.
Example below is setting Accept-language and User-Agent

$options = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"Accept-Language: en-US,en;q=0.9,ru;q=0.8\r\n".
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.50 Safari/537.36 OPR/65.0.3467.16 (Edition beta)\r\n"
  )
);

$context = stream_context_create($options);
$String = file_get_contents($url, false, $context);

E
entermix, 2019-10-28
@entermix

Turn on error output and see what happens there.

error_reporting(E_ALL);
ini_set('display_startup_errors', 1);
ini_set('display_errors', '1');

https://www.php.net/manual/ru/function.error-report...

E
Exploding, 2019-10-28
@Exploding

Because cUrl needs to be used.
It's strange that you

... with one specific site, this does not roll out ...

It should be the other way around.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question