-8

I try to download sourcecode of a twitter webpage with a php code:

$continut_pp = file_get_contents('https://twitter.com/'); echo $continut_pp;

The problem is that result is null. I think the problem comes from the https, well how I can extract an https source coude in PHP code?

  • What do you want to get from twitter? You can use its API : http://stackoverflow.com/questions/12916539/simplest-php-example-for-retrieving-user-timeline-with-twitter-api-version-1-1 You could use curl in PHP code to request the page, but you'll need to be sure that you can do this. And I'm pretty sure you can't on twitter (read the terms and conditions) – mogosselin Jun 24 '14 at 15:15
  • lol. do you mean the HTML response? because you most certainly cannot get the source code!! – RaggaMuffin-420 Jun 24 '14 at 15:15
  • 1
    what does `get_data` do? – putvande Jun 24 '14 at 15:15

1 Answers1

1

Try using the file_get_contents function. Just give it the full web address and it should return the HTML source. I hope this helps.


As the first function I suggested did not work, you could try this one: var markup = document.documentElement.innerHTML;. However, it is in Javascript and not PHP.

Jamie1596
  • 104
  • 1
  • 1
  • 11