Page 2 of 2 FirstFirst 12
Results 21 to 37 of 37
  1. #21
    neilb's Avatar
    neilb is offline Private Member
    Join Date
    December 2014
    Location
    South Africa
    Posts
    65
    Thanks
    1
    Thanked 21 Times in 13 Posts

    Default

    Are any of you guys Wordpress fans? I currently work with integrating API's but most betting providers only provide XML feeds which is now old school compared with json feeds.

    I'd like to create such a plugin which is JavaScript based, that way it would be constantly up to date. What are the most popular feeds?


    Sent from my iPhone using Tapatalk

  2. #22
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,994
    Blog Entries
    3
    Thanks
    1,418
    Thanked 1,319 Times in 783 Posts

    Default

    Quote Originally Posted by PromoteCasino View Post
    How long has it taken to get to this stage and how long before you are happy with it? Also how much time will it take each day once you have it set up to update the feeds, or does that happen automatically.
    It used to be a full site with 168 bookies, with a paid feed, this here is a free version I'm toying around with when I have the time. It will see the light of day again, eventually. The feed is updated automatically, though I switch it off when I'm not working on the site.

  3. The Following User Says Thank You to DanHorvat For This Useful Post:

    PromoteCasino (10 December 2014)

  4. #23
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,994
    Blog Entries
    3
    Thanks
    1,418
    Thanked 1,319 Times in 783 Posts

    Default

    Neil, how do you intend to combine 20 different feeds into one?

  5. #24
    Jericho is offline Public Member
    Join Date
    December 2014
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi Thanks for all the responses. The devs are using curl. Will post below.

  6. #25
    Jericho is offline Public Member
    Join Date
    December 2014
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    edit

  7. #26
    Jericho is offline Public Member
    Join Date
    December 2014
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    $url="http://lines.betdsi.com/";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, $url); // get the url contents
    echo $data = curl_exec($ch); // execute curl request
    //$xml = simplexml_load_string($data);
    //print_r($xml);
    curl_close($ch);
    exit;

  8. #27
    Jericho is offline Public Member
    Join Date
    December 2014
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    for some reason it will not let me post the code without moderation. I WILL FIND ANOTHER WAY!

  9. #28
    neilb's Avatar
    neilb is offline Private Member
    Join Date
    December 2014
    Location
    South Africa
    Posts
    65
    Thanks
    1
    Thanked 21 Times in 13 Posts

    Default

    The way I would do it is add them in separately, massage the data and then output it all into a table, I can add a switch for each provider so you could turn each one on/off


    Sent from my iPhone using Tapatalk

  10. #29
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    34,012
    Thanks
    4,546
    Thanked 9,305 Times in 5,988 Posts

    Default

    Instead of trying to find a way around moderation, ask a moderator, myself or Anthony to approve a post if it ends up in the moderation que.

    I have approved the post.

    Rick
    Universal4

  11. #30
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,994
    Blog Entries
    3
    Thanks
    1,418
    Thanked 1,319 Times in 783 Posts

    Default

    This is what I've got.

    $curl = curl_init($feedurl);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($curl, CURLOPT_HEADER, TRUE);
    curl_setopt($curl, CURLOPT_ENCODING, "gzip,deflate");
    $xml = curl_exec($curl);
    var_dump(curl_getinfo($curl, CURLINFO_SIZE_DOWNLOAD));

    // Check if any error occurred
    if(!curl_errno($curl)) {
    $info = curl_getinfo($curl);
    echo 'Took ' , $info['total_time'] , ' seconds to send a request to ' , $info['url'] , "</BR>";
    }
    else {
    echo "There was some sort of error." , "/<BR>";
    }

    curl_close($curl);

    $xmlStr = file_get_contents("$feedurl") or die("can't get file");
    Professional bizdev can help you, the affiliate, to negotiate better terms with casinos. PM for details and a free evaluation of what I can do for you. All geos.

  12. #31
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,994
    Blog Entries
    3
    Thanks
    1,418
    Thanked 1,319 Times in 783 Posts

    Default

    So...If we'd use a BetDSI feed in my code, it would look like this:

    $url="http://lines.betdsi.com/";
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, TRUE);
    curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");

    $data = curl_exec($ch);
    var_dump(curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD));
    curl_close($ch);

    $xml = file_get_contents("$feedurl") or die("can't get file");
    Show that to your devs. I guess it should work. $xml string will have all your data. I guess gzip&deflate line is optional, depends on whether the source is gzipped.
    Professional bizdev can help you, the affiliate, to negotiate better terms with casinos. PM for details and a free evaluation of what I can do for you. All geos.

  13. #32
    Pmig is offline Private Member
    Join Date
    August 2012
    Posts
    189
    Thanks
    48
    Thanked 78 Times in 55 Posts

    Default

    why dont you use simplexml_load_file() and then work on the file with xpath?

    Is faster and is very easy to work it.

  14. #33
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,994
    Blog Entries
    3
    Thanks
    1,418
    Thanked 1,319 Times in 783 Posts

    Default

    Yes it is, it's my preferred way of parsing XML.

    I had to dig deep through my files to find a curl example, and in case of that feed, it was only possible to parse it with curl. Because the morons gzipped the feed to save their bandwidth and make my life miserable.

    I'm not sure about the BetDSI feed. If it can be parsed with simpleXML, that's the way it should be done.

  15. The Following User Says Thank You to DanHorvat For This Useful Post:

    Jericho (18 December 2014)

  16. #34
    Pmig is offline Private Member
    Join Date
    August 2012
    Posts
    189
    Thanks
    48
    Thanked 78 Times in 55 Posts

    Default

    yep could be with sometinhg like:

    $lines = $xml->xpath('//line/../..');
    foreach($lines as $line) {

    $hometeam = $line->game->attributes()->htm;
    $hometeamodds = $line->game->line->attributes()->hoddsh;

    print $hometeam;
    print $hometeamodds;
    }

    You need to add the other fields, but the example is there.. Its so simple as you can see Please note I up 2 levels on xpath to get the team names and other data.

  17. The Following User Says Thank You to Pmig For This Useful Post:

    Jericho (18 December 2014)

  18. #35
    Jericho is offline Public Member
    Join Date
    December 2014
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks I will ask the team. Were you able to successfully parse the xml with this code ?

  19. #36
    Pmig is offline Private Member
    Join Date
    August 2012
    Posts
    189
    Thanks
    48
    Thanked 78 Times in 55 Posts

    Default

    I'm building a odds comparison site and for sure that code works for most of the feeds out there. That is just an example The "logic" is there it's just a matter of your dev understanding how to fetch each field.

    Please note I wrote that code "live" (without testing) while answer the thread, could have some minor errors but easy fixable. It's just to you have a idea where to start.

  20. #37
    Jericho is offline Public Member
    Join Date
    December 2014
    Posts
    10
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi Team,

    I hate when people ask for help, get it, then abandon thread.

    If any pour soul searches for this and finds it. The Dev didnt admit it, but after checking their code it looks Danhorvat was onto something. I see they had to deflate / unzip the xml to get it working.

    Thanks for everyone's help!

Page 2 of 2 FirstFirst 12

Posting Permissions

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