Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2.  
  3. $code = '6082761178328272';
  4. $pin = '15388571';
  5.  
  6. $data = post_curl('https://www.starbucks.com/card/guestbalance', array('Card.Number' => $code, 'Card.Pin' => $pin));
  7.  
  8. if(preg_match_all('/<span class="fetch_balance_value">(.*?)<\/span>/', $data, $matches))
  9. echo 'Good code - '.$code.', balance: '. $matches[1][0]."\n";
  10. else
  11. echo 'Wrong code - '.$code;
  12.  
  13. function post_curl($url, $postfields = '')
  14. {
  15.  
  16. $ch = curl_init();
  17. curl_setopt($ch, CURLOPT_URL, $url);
  18. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  19. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  20. curl_setopt($ch, CURLOPT_POST, 1);
  21. curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
  22. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  23. $result = curl_exec($ch);
  24.  
  25. return $result;
  26.  
  27. }
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement