BFHModsBFHeroes 42
RSS
 

Get Adobe Flash player



 





Page 1 of 11
Forum moderator: McFluff, Dutchassasin 
Forum » Battlefield heroes » General Chat » Webstore Hunter (my final gift...)
Webstore Hunter
b00stedDate: Thursday, 2010-09-30, 4:18 AM | Message # 1
Private
Group: Users
Messages: 18
Awards: 0
Reputation: 0
Status: Offline
There has been a updated program made please scroll down to see it in post 8 as this info is now out dated

Well now that I have become a mod I guess I should cut down on the "not so good things" i do.. here is the php code for the item browser. you need to use on a php server that supports curl.

Here is how the url layout should look as well:

Code
http://www.YOURSITEHERE.com/bfh.php?page=50&username=BFHEMAIL&password=BFHPASS

replace YOURSITEHERE with your site of course.
replace BFHEMAIL with the email you login to BFH with (or alt account)
replace BFHPASS with your password you use.

where it says page=50 is where you choose what page you want to browse, it will display 100 links per page.

atm there seems to be a change in the html code on the webstore pages so the current bundles are not displaying, a quick look and tweak of the code of this will fix that.

enjoy!

- b00sted

Code

<html>
<head>

</head>
<body>

<?php
$userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6";

// INIT CURL
$ch = curl_init();

// SET URL FOR THE POST FORM LOGIN
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch, CURLOPT_URL, 'https://www.battlefieldheroes.com/en/user/login?destination=/');

// ENABLE HTTP POST
curl_setopt ($ch, CURLOPT_POST, 1);

// SET POST PARAMETERS : FORM VALUES FOR EACH FIELD
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'mail=' . $_GET['username'] . '&password=' . $_GET['password']);

// IMITATE CLASSIC BROWSER'S BEHAVIOUR : HANDLE COOKIES
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');

# Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
# not to print out the results of its query.
# Instead, it will return the results as a string return value
# from curl_exec() instead of the usual true/false.
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

// EXECUTE 1st REQUEST (FORM LOGIN)
$store = curl_exec ($ch);

if(!isset($_GET['page'])){
      $_GET['page'] = 1;
}

$num = $_GET['page'] * 100;
$begin = $num - 100;

$begin += 10000;
$num += 10000;

if(strpos($store, '<h2>Please make sure you fill in a correct email and password.</h2>') !== FALSE){
      echo "<h3>You have supplied invalid login credentials</h3>";
} else {
      echo "<h3>You are now viewing $begin to $num</h3>";

      for($i=$begin; $i<$num; $i++){

        $target_url = "https://www.battlefieldheroes.com/store/buy/$i";

        curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
        curl_setopt($ch, CURLOPT_URL,$target_url);
        curl_setopt($ch, CURLOPT_FAILONERROR, true);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($ch, CURLOPT_AUTOREFERER, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
        curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
        $html = curl_exec($ch);

        if ($html) {
          $persona_pos = strpos($html, '<div class="select-persona">');

          if($persona_pos !== FALSE){
            $item_pos = strpos($html, '<div id="store-bundle">');
            $start = strpos($html, '<h2>', $item_pos) + 4;
            $end = strpos($html, '</h2>', $start);
            $offset = $end - $start;
            $message = '<span style="color: green;">' . substr($html, $start, $offset) . '</span>';
          }

          $insufficient_funds_pos = strpos($html, '<div id="lackingfunds"');

          if($insufficient_funds_pos !== FALSE){
            $start = strpos($html, '<p>', $insufficient_funds_pos) + 3;
            $end = strpos($html, '</p>', $start);
            $offset = $end - $start;
            $message = '<span style="color: red;">' . substr($html, $start, $offset) . '</span>';
          }

          if(isset($message) && $message != ""){
            echo "<a href='$target_url' target='_blank'>$target_url</a> - ";
            echo $message."<br />";
            flush();
          }
        }

      }
}

// CLOSE CURL
curl_close ($ch);
?>

</body>
</html>


Message edited by b00sted - Thursday, 2010-11-11, 6:47 PM
 
GuestDate: Thursday, 2010-09-30, 6:14 AM | Message # 2
Group: Guests





Hi, it's bombomaster (or Stupido1). I'm in the NCC too and was wondering if you could help with this!
 
McFluffDate: Thursday, 2010-09-30, 7:31 PM | Message # 3
Lieutenant colonel
Group: Administrators
Messages: 103
Awards: 1
Reputation: 12
Status: Offline
Woah, you are a mod nao? Well congratulations...
Anyway thanks for sharing this happy


 
matthijsDate: Thursday, 2010-09-30, 10:49 PM | Message # 4
Sergeant
Group: Users
Messages: 24
Awards: 0
Reputation: 0
Status: Offline
Thx smile

EDIT: I get this error sad :Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/*********/public_html/bfh.php on line 57
Someone knows how to fix?




Message edited by matthijs - Thursday, 2010-09-30, 11:09 PM
 
b00stedDate: Tuesday, 2010-10-05, 5:48 PM | Message # 5
Private
Group: Users
Messages: 18
Awards: 0
Reputation: 0
Status: Offline
the site you are using does nto have curl installed
 
matthijsDate: Friday, 2010-10-08, 11:38 PM | Message # 6
Sergeant
Group: Users
Messages: 24
Awards: 0
Reputation: 0
Status: Offline
oh okay thx for answer smile

 
GuestDate: Tuesday, 2010-10-12, 3:48 AM | Message # 7
Group: Guests





UM i cant go to the page so can you take me a picture of what you did earlier please
 
b00stedDate: Thursday, 2010-11-11, 5:25 PM | Message # 8
Private
Group: Users
Messages: 18
Awards: 0
Reputation: 0
Status: Offline
well.. I guess I can never escape looking for lil hidden gems. now that my son was born I do not have the time anymore so I will share my private app I had a friend make for me with you guys. By far it is not fool proof but if you can get the timing right for when to scan it may become a valuable tool.

Poodude's BFH Store Scavenger

 
me.hero1Date: Thursday, 2010-11-11, 6:40 PM | Message # 9
Group: Guests





what do i put in YOURSITEHERE ?
 
GuestDate: Thursday, 2010-11-11, 7:45 PM | Message # 10
Group: Guests





lol i cant download your progam
halp
 
GuestDate: Saturday, 2010-11-13, 4:23 PM | Message # 11
Group: Guests





wat do i put in YOURSITEHERE ?
 
GuestDate: Thursday, 2011-05-05, 11:19 PM | Message # 12
Group: Guests





How to do that pls make tutorial...
and this store scavenger is deleted :(
 
perawalgeDate: Monday, 2011-12-26, 2:35 PM | Message # 13
Group: Guests





some eyebrows but is nonetheless a delicious delight.For specialty chocolates, Montezuma's Chocolates isalso be available as an advertisement at your weekend newspaper at your residence which you will need to ensurehustle and bustle of your city.two. Shopping in DublinDublin is a shoppers paradise with Henry Street, Graftonor a simple headache, pay a visit to Culpepper, a herbal specialist that opened in 1927 and is still goingalso streets with the City Centre these types of as Liberty Blue, the Carter Type Emporium and stores like Rio, Brazil, shopping centres to choose from and here we have picked out a few for you personally not to miss.The main shoppingfor the Blanchardstown Shopping Centre stay at the Ballymum Plaza, or even the Park Plaza Tyrrelstown. For TheChanel is you thing then you must visit here. Other shops located on Grafton Street include Next, River-houseware and cosmetics.Other notable shops on Henry Street include Penny's, Marks & Spencers, Debenhams,you customize your fashion style with quality products that are anything but commonplace.You have a blind
 
Forum » Battlefield heroes » General Chat » Webstore Hunter (my final gift...)
Page 1 of 11
Search:








 
Statistics Forum
Recent Posts Readable topic Top Users New User
  • [mod] Dedicated Servers
  • [community] make me a mod
  • Battlefield Heroes'42
  • so close on getting a chopper ...
  • [TUTORIAL] How to start moddin...
  • Mods, Caught on Tape/Screensho...
  • [TUTORIAL] How to make custom ...
  • Battlefield Heroes'42
  • My mods
  • how to add new buildings?
  • Apache_Thunder
  • McFluff
  • SgtColbert
  • Philly
  • Conorman
  • Dutchassasin
  • Mrtn
  • Solidsnail
  • wakamonkey
  • SwiftGreen
  • karlosdelluka
  • gamervajiko
  • GANS1917
  • traimientayts
  • gergoforma1
  • mvja12013
  • taylormmocollege
  • Prevé
  • ansh12kumar
  • dasarandasaran11
  • Based on the game Battlefield Heroes By Electronic Arts™ and DICE™ | By using this website you agree to our Tearms Of Use
    Some images are taken from JW Renders, check it outs it has some cool stuff. Some translations provided by uCause.esigned by CENTROARTS