Rewrite content on the fly


#1

Hi,
How is it possible to rewrite website on the fly.
For example, when i use exeoutput as browser and browse other website, i would like to rewrite the source of this website by php script before display it.
I need it for something like cms for website i did. When anybode browse this website by regular browser chrome, firefox, opera it looks as it should look for enduser, but when owner of website browse by exeoutput application i need to rewrite it that he could edit and manage his website. How can i do it?


#2

You should use a PHP script to download the HTML code from the website, modify the content you want and return it. Something like:
<?php
$ret = download(…)
// modify $ret
echo $ret;


#3

is it only option? is it possible to you to enable option like this?
parse on the fly
css inject, js inject on the fly
regex string replace

in your answer if i use exeoutput as browser and browse another website, how can I catch url and use exeoutput it to render downloaded website, how to use it with cookies etc?


#4

You won’t be able to modify browsed content, this would require a content filter and this is not available through PHP.


#5

have you got any advice how to achieve it?


#6

I had thought about this method some time back and found http://getcontenttools.com/

Not even sure feasible and is still on my whiteboard under things to explore / try. When I read through their docs got impression it might work with API but never took it any further:)


#7

Old Teacher thank you for your link, this soft is very nice, but my question was about something else.
I need to use something like ambasador pattern. You and gdgsoft could start to explore about this pattern here https://medium.com/@clemens.wolff/using-the-ambassador-pattern-for-reliable-pipes-and-filters-text-processing-9ebbea8f82c4

I am asking developers for positive consideration of my request for the addition of real-time filtering and substitution of the html source. Please please please.


#8

Found something interesting which can help you understand what i need :slight_smile:




#9

My bad, was on my phone and missed your point on the small screen:)