SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    curl doesnt quite cut it

    i am using curl to grab search results from web pages
    i want to use it on this site
    http://www.twitch.tv/search?query=da...n%20dinh&stp=1
    but the source code returned does not have the title, description etc in the source code
    instead they have variables which look like {{title}}, {{description}} in its place
    i have searched all of the java script files and all the other files in the source code for these variable values and cannot find them
    but if the web browser can translate these variables into their values, there must be a way i can do it in php
    does anyone know if there are other functions like curl that have the functionality i am looking for?

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Instead of trying to scrap the page use the Develop API.
    https://github.com/justintv/Twitch-API/wiki/API

    And the reason why the browser can translate is because of Javascript. What you say was a template for Javascript.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2010
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what makes u think they have an api?
    is there a way to simulate the browser rendering so php can execute the java script or something?

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chopficaro View Post
    what makes u think they have an api?
    I just linked to it. From their link labeled "Develop API"
    https://github.com/justintv/Twitch-A...earch-Resource
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •