Is it possible to execute an external page on the client and get the JSON result using PHP?

0

Good afternoon!

It is the following, I have a URL of a forum on the Internet that when it accesses it it returns in the JSON format the last posts viewed by a certain user. Since it is external, I do not know how it works and I believe it is by the cookies that the forum left on the user's computer.

I wanted to use this URL for when the user logs on to my site I put something like: "5 Latest posts viewed by you in the FORUM TAL".

But just to do that this URL would have to be executed somehow in the client browser and I would still have to have access to the content returned by that URL.

Is it possible for me to do this using PHP or some other technology?

Thank you!

    
asked by anonymous 16.05.2017 / 20:52

1 answer

2

You can use Ajax for this. Ex:

$.ajax({
  type: 'GET',
  url: 'URL DE RETORNO JSON',
  dataType: 'json',
  success: function(data){
    $('body').append(data.titulo);
  }
})

In case it is only modify as the return of JSON

    
16.05.2017 / 22:39