Jump to content

AndrewFerrara

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

AndrewFerrara's Achievements

Member

Member (2/5)

0

Reputation

  1. Need to have the javascript photo gallery on this page http://www.halogamertags.com/dachs/ center on the screen. For example if you scroll down to where the second puppy is at the top of your browser and click on the thumbnail the gallery is at the top of the web page. Thanks, Andrew Javascript: <!-- The JavaScript --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { var $ps_albums = $('#ps_albums'); var $ps_container = $('#ps_container'); var $ps_overlay = $('#ps_overlay'); var $ps_close = $('#ps_close'); /** * when we click on an album, * we load with AJAX the list of pictures for that album. * we randomly rotate them except the last one, which is * the one the User sees first. We also resize and center each image. */ $ps_albums.children('div').bind('click',function(){ var $elem = $(this); var album_name = 'album' + parseInt($elem.index() + 1); var $loading = $('<div />',{className:'loading'}); $elem.append($loading); $ps_container.find('img').remove(); $.get('photostack.php', {album_name:album_name} , function(data) { var items_count = data.length; for(var i = 0; i < items_count; ++i){ var item_source = data[i]; var cnt = 0; $('<img />').load(function(){ var $image = $(this); ++cnt; resizeCenterImage($image); $ps_container.append($image); var r = Math.floor(Math.random()*41)-20; if(cnt < items_count){ $image.css({ '-moz-transform' :'rotate('+r+'deg)', '-webkit-transform' :'rotate('+r+'deg)', 'transform' :'rotate('+r+'deg)' }); } if(cnt == items_count){ $loading.remove(); $ps_container.show(); $ps_close.show(); $ps_overlay.show(); } }).attr('src',item_source); } },'json'); }); /** * when hovering each one of the images, * we show the button to navigate through them */ $ps_container.live('mouseenter',function(){ $('#ps_next_photo').show(); }).live('mouseleave',function(){ $('#ps_next_photo').hide(); }); /** * navigate through the images: * the last one (the visible one) becomes the first one. * we also rotate 0 degrees the new visible picture */ $('#ps_next_photo').bind('click',function(){ var $current = $ps_container.find('img:last'); var r = Math.floor(Math.random()*41)-20; var currentPositions = { marginLeft : $current.css('margin-left'), marginTop : $current.css('margin-top') } var $new_current = $current.prev(); $current.animate({ 'marginLeft':'250px', 'marginTop':'-385px' },250,function(){ $(this).insertBefore($ps_container.find('img:first')) .css({ '-moz-transform' :'rotate('+r+'deg)', '-webkit-transform' :'rotate('+r+'deg)', 'transform' :'rotate('+r+'deg)' }) .animate({ 'marginLeft':currentPositions.marginLeft, 'marginTop' :currentPositions.marginTop },250,function(){ $new_current.css({ '-moz-transform' :'rotate(0deg)', '-webkit-transform' :'rotate(0deg)', 'transform' :'rotate(0deg)' }); }); }); }); /** * close the images view, and go back to albums */ $('#ps_close').bind('click',function(){ $ps_container.hide(); $ps_close.hide(); $ps_overlay.fadeOut(400); }); /** * resize and center the images */ function resizeCenterImage($image){ var theImage = new Image(); theImage.src = $image.attr("src"); var imgwidth = theImage.width; var imgheight = theImage.height; var containerwidth = 460; var containerheight = 330; if(imgwidth > containerwidth){ var newwidth = containerwidth; var ratio = imgwidth / containerwidth; var newheight = imgheight / ratio; if(newheight > containerheight){ var newnewheight = containerheight; var newratio = newheight/containerheight; var newnewwidth =newwidth/newratio; theImage.width = newnewwidth; theImage.height= newnewheight; } else{ theImage.width = newwidth; theImage.height= newheight; } } else if(imgheight > containerheight){ var newheight = containerheight; var ratio = imgheight / containerheight; var newwidth = imgwidth / ratio; if(newwidth > containerwidth){ var newnewwidth = containerwidth; var newratio = newwidth/containerwidth; var newnewheight =newheight/newratio; theImage.height = newnewheight; theImage.width= newnewwidth; } else{ theImage.width = newwidth; theImage.height= newheight; } } $image.css({ 'width' :theImage.width, 'height' :theImage.height, 'margin-top' :-(theImage.height/2)-10+'px', 'margin-left' :-(theImage.width/2)-10+'px' }); } }); </script>
  2. Thanks for the replies, - This is in development haven't bought hosting yet so it's on that domain. - The menu hasn't been styled, it will be in the black nav bar. - What is your internet speeds? Working on fixing the centering issue with the photo gallery. Thanks again!
  3. I am making a website for a dachshund puppy breeder which happens to be my mom. The site is still in the early stages of development. Clicking the puppies thumbnail opens a javascript photo gallery. http://www.halogamertags.com/dachs Thanks for your help
  4. If you get no errors with this code you are connected to your database. <?php mysql_connect('localhost', 'username', 'password') or die (mysql_error()); mysql_select_db('database') or die (mysql_error()); ?>
  5. So, We are trying to create a animation using the gifs in a directory by using the first 10 images. We just cannot figure out how to do the animation.. needs to have a 3 second delay between each frame Heres the code at the moment. Which creates the starting images and also sorts the images in the directory by time.. <?php $time = date("YmdHis"); $handle_data = file_get_contents('http://www.bungie.net/Stats/Halo3/Nightmap.ashx'); $img = new Imagick(); $img->readImageBlob($handle_data); $img->writeImage('nightmap/'.$time.'.gif'); foreach (glob('nightmap/*.gif') as $f) { # store the image name $list[] = $f; } sort($list);# sort is oldest to newest, $gif_0 = array_pop($list); $gif_1 = array_pop($list); $gif_2 = array_pop($list); $gif_3 = array_pop($list); $gif_4 = array_pop($list); $gif_5 = array_pop($list); $gif_6 = array_pop($list); $gif_7 = array_pop($list); $gif_8 = array_pop($list); $gif_9 = array_pop($list); ?>
  6. I want to create an animation using an image that refreshes every hour hosted at this url: http://www.bungie.net/stats/reach/nightmap.ashx What is the best way to store the images and then animate(loop) the 24 most recent images? Should I use a mysql database to store it or something else? What are your thoughts? Thanks
  7. Need help with the regex of this script, I am trying to grab just the number inside of the div with the class of content, not the added Players part. <?php error_reporting(E_ALL); ini_set('display_errors', 1); include(dirname(__FILE__) .'/include/simple_html_dom.php'); //playlist page $playlist_page = 'http://www.bungie.net/stats/reach/online.aspx'; //create dom $html = new simple_html_dom(); $html->load_file($playlist_page); //get all divs $get_divs = ''; $get_divs_el = $html->find('li.glowBox div'); if (preg_match_all('~class="content"~', $get_divs_el[0]->innertext, $matches)) { $get_divs = $matches[0]; } print_r($get_divs_el); print_r($get_divs); ?> <ul> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl00_nameLink" href="/stats/reach/playlists.aspx?p=29898">NOBLE MAP PACK</a> </h4> 1,192 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl01_nameLink" href="/stats/reach/playlists.aspx?p=30228">COMMUNITY SLAYER</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl02_nameLink" href="/stats/reach/playlists.aspx?p=30353">GRIFBALL</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl03_nameLink" href="/stats/reach/playlists.aspx?p=30446">FIREFIGHT LIMITED</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl04_nameLink" href="/stats/reach/playlists.aspx?p=30291">FIREFIGHT ARCADE</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl05_nameLink" href="/stats/reach/playlists.aspx?p=25886">RUMBLE PIT</a> </h4> 4,586 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl06_nameLink" href="/stats/reach/playlists.aspx?p=29220">LIVING DEAD</a> </h4> 4,684 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl07_nameLink" href="/stats/reach/playlists.aspx?p=25885">TEAM SLAYER</a> </h4> 14,501 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl08_nameLink" href="/stats/reach/playlists.aspx?p=29978">MLG</a> </h4> 1,457 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl09_nameLink" href="/stats/reach/playlists.aspx?p=28808">TEAM SWAT</a> </h4> 9,670 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl10_nameLink" href="/stats/reach/playlists.aspx?p=29219">TEAM SNIPERS</a> </h4> 3,051 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl11_nameLink" href="/stats/reach/playlists.aspx?p=28474">TEAM OBJECTIVE</a> </h4> 1,208 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl12_nameLink" href="/stats/reach/playlists.aspx?p=28475">MULTI TEAM</a> </h4> 2,306 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl13_nameLink" href="/stats/reach/playlists.aspx?p=28476">BIG TEAM BATTLE</a> </h4> 6,621 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl14_nameLink" href="/stats/reach/playlists.aspx?p=28477">INVASION</a> </h4> 2,475 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl15_nameLink" href="/stats/reach/playlists.aspx?p=28478">FIREFIGHT</a> </h4> 6,302 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl16_nameLink" href="/stats/reach/playlists.aspx?p=28479">SCORE ATTACK</a> </h4> 1,568 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl17_nameLink" href="/stats/reach/playlists.aspx?p=28779">CO-OP CAMPAIGN</a> </h4> 285 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl18_nameLink" href="/stats/reach/playlists.aspx?p=28481">TEAM ARENA</a> </h4> 1,228 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl19_nameLink" href="/stats/reach/playlists.aspx?p=28480">DOUBLES ARENA</a> </h4> 1,571 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl20_nameLink" href="/stats/reach/playlists.aspx?p=30227">FFA ARENA</a> </h4> 235 Players </div> </li> </ul>
  8. Alright, I'm trying to get the numbers in divs with with the class of content I have been using this but its not working <?php error_reporting(E_ALL); ini_set('display_errors', 1); include(dirname(__FILE__) .'/include/simple_html_dom.php'); //playlist page $playlist_page = 'http://www.bungie.net/stats/reach/online.aspx'; //create dom $html = new simple_html_dom(); $html->load_file($playlist_page); //get all divs $get_divs = ''; $get_divs_el = $html->find('li.glowBox'); if (preg_match_all('|<div[^>]+>(.*)</div>|U', $get_divs_el[0]->innertext, $matches)) { $get_divs = $matches[0]; } print_r($get_divs_el); print_r($get_divs); ?> <ul> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl00_nameLink" href="/stats/reach/playlists.aspx?p=29898">NOBLE MAP PACK</a> </h4> 1,192 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl01_nameLink" href="/stats/reach/playlists.aspx?p=30228">COMMUNITY SLAYER</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl02_nameLink" href="/stats/reach/playlists.aspx?p=30353">GRIFBALL</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl03_nameLink" href="/stats/reach/playlists.aspx?p=30446">FIREFIGHT LIMITED</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl04_nameLink" href="/stats/reach/playlists.aspx?p=30291">FIREFIGHT ARCADE</a> </h4> Available 2.08.2011 </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl05_nameLink" href="/stats/reach/playlists.aspx?p=25886">RUMBLE PIT</a> </h4> 4,586 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl06_nameLink" href="/stats/reach/playlists.aspx?p=29220">LIVING DEAD</a> </h4> 4,684 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl07_nameLink" href="/stats/reach/playlists.aspx?p=25885">TEAM SLAYER</a> </h4> 14,501 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl08_nameLink" href="/stats/reach/playlists.aspx?p=29978">MLG</a> </h4> 1,457 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl09_nameLink" href="/stats/reach/playlists.aspx?p=28808">TEAM SWAT</a> </h4> 9,670 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl10_nameLink" href="/stats/reach/playlists.aspx?p=29219">TEAM SNIPERS</a> </h4> 3,051 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl11_nameLink" href="/stats/reach/playlists.aspx?p=28474">TEAM OBJECTIVE</a> </h4> 1,208 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl12_nameLink" href="/stats/reach/playlists.aspx?p=28475">MULTI TEAM</a> </h4> 2,306 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl13_nameLink" href="/stats/reach/playlists.aspx?p=28476">BIG TEAM BATTLE</a> </h4> 6,621 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl14_nameLink" href="/stats/reach/playlists.aspx?p=28477">INVASION</a> </h4> 2,475 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl15_nameLink" href="/stats/reach/playlists.aspx?p=28478">FIREFIGHT</a> </h4> 6,302 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl16_nameLink" href="/stats/reach/playlists.aspx?p=28479">SCORE ATTACK</a> </h4> 1,568 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl17_nameLink" href="/stats/reach/playlists.aspx?p=28779">CO-OP CAMPAIGN</a> </h4> 285 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl18_nameLink" href="/stats/reach/playlists.aspx?p=28481">TEAM ARENA</a> </h4> 1,228 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl19_nameLink" href="/stats/reach/playlists.aspx?p=28480">DOUBLES ARENA</a> </h4> 1,571 Players </div> </li> <li class="glowBox"> <div class="corner bottomLeft"></div> <div class="corner topRight"></div> <div class="content"> <h4><a id="ctl00_mainContent_playlistRepeater_ctl20_nameLink" href="/stats/reach/playlists.aspx?p=30227">FFA ARENA</a> </h4> 235 Players </div> </li> </ul>
  9. How do you get the values in an array and name them as variables? Lets say I want the 0 and the 2... Array ( [0] => 02.02.2011 [1] => 97% [2] => 538 [3] => 20 [4] => 63,247 (2.20) [5] => 77,639 [6] => 195,617 [7] => 09.13.2010 )
  10. I tried this: /\b(\b(.*?)\bof\b/ doesn't seem to work
  11. I'm trying to get a value which changes but is always contained the same way this is the text Next: Brigadier (81654 of 220000) as you can see below this is the value i need to get I just can't figure out the RegEx for it? help please! Smaller CODE <div class="rankBar"> <p class="grade"><span id="ctl00_mainContent_identityBar_currentGlobalRankLabel" class="current">Colonel Grade 3</span><span id="ctl00_mainContent_identityBar_nextGlobalRankLabel" class="future">Next: Brigadier (81654 of 220000)</span></p> <div class="rankMeter"> <div id="ctl00_mainContent_identityBar_rankBarPanel" class="bar" style="width:37%;"> <span></span> </div> </div> FULL CODE <div id="ctl00_mainContent_identityBar_idbarPanel"> <div class="glowBox idRankContainer"> <div class="corner bottomLeft"></div> <div class="lattice"></div> <div class="content"> <a href="/Stats/Reach/default.aspx?player=l RaH l" id="ctl00_mainContent_identityBar_avatar" class="avatar"><img id="ctl00_mainContent_identityBar_emblemImg" src="/Stats/emblem.ashx?s=70&0=0&1=0&2=0&3=0&fi=0&bi=0&fl=0&m=3" style="height:70px;width:70px;border-width:0px;"></a> <div class="idRank"> <div class="userInfo"> <img id="ctl00_mainContent_identityBar_namePlateImg" class="img_plate" src="/images/reachstats/nameplates/512.png" alt="" style="height:30px;width:60px;border-width:0px;"> <a href="/projects/reach/article.aspx?ucc=faq&cid=28756"><img id="ctl00_mainContent_identityBar_currentGlobalRankImage" title="Colonel Grade 3" class="img_rankIcon" src="/images/reachstats/grades/med/A4BF62C6-1E3F-468A-9A73-8237600B2AD3.png" alt="Colonel Grade 3" style="height:40px;width:40px;border-width:0px;"></a> <h2><a href="/Stats/Reach/default.aspx?player=l RaH l" id="ctl00_mainContent_identityBar_gamerTag">l RaH l</a> - FLIR</h2> </div> <div class="rankBar"> <p class="grade"><span id="ctl00_mainContent_identityBar_currentGlobalRankLabel" class="current">Colonel Grade 3</span><span id="ctl00_mainContent_identityBar_nextGlobalRankLabel" class="future">Next: Brigadier (81654 of 220000)</span></p> <div class="rankMeter"> <div id="ctl00_mainContent_identityBar_rankBarPanel" class="bar" style="width:37%;"> <span></span> </div> </div> </div> </div> </div> </div> <div class="glowBox shields"> <div class="corner topRight"></div> <div class="lattice"></div> <div class="content"> <ul> <li class="campaign"> <p>Campaign</p> <img id="ctl00_mainContent_identityBar_spCampaignImage" title="Completed Legendary Difficulty" alt="Campaign Progress" src="/images/reachstats/campaign_progress/legendary.png" style="height:59px;width:54px;border-width:0px;"> </li> <li class="coop"> <p>Co-op</p> <img id="ctl00_mainContent_identityBar_coopCampaignImage" title="Completed Normal Difficulty" alt="Coop Campaign Progress" src="/images/reachstats/campaign_progress/normal.png" style="height:59px;width:54px;border-width:0px;"> </li> <li class="arena_display"> <p>Arena</p> <a id="ctl00_mainContent_identityBar_arenaLink" href="/stats/reach/careerstats/playlists.aspx?player=l RaH l&vc=2"><img id="ctl00_mainContent_identityBar_currentBestArenaDivisionImg" alt="" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"></a> <div class="glowBox popOut po_arenaSeason2"> <div class="corner topRight"></div> <div class="corner bottomLeft"></div> <div class="content"> <h4>Arena Season 6</h4> <div class="twoColumn"> <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_arenaImage" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"> <h5>Doubles Arena</h5> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_divisionName">Not Qualified Yet</p> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_lastSeasonControl">Last Season: <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_lastSeasonImage" src="/images/reachstats/arena_div/0.png" style="height:23px;width:23px;border-width:0px;"> </p> </div> <div class="rule_transparent"></div> <div class="twoColumn"> <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_arenaImage" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"> <h5>FFA Arena</h5> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_divisionName">Not Qualified Yet</p> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_lastSeasonControl">Last Season: <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_lastSeasonImage" src="/images/reachstats/arena_div/0.png" style="height:23px;width:23px;border-width:0px;"> </p> </div> <div class="rule_transparent"></div> <div class="twoColumn"> <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_arenaImage" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"> <h5>Team Arena</h5> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_divisionName">Not Qualified Yet</p> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_lastSeasonControl">Last Season: <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_lastSeasonImage" src="/images/reachstats/arena_div/0.png" style="height:23px;width:23px;border-width:0px;"> </p> </div> </div> </div> </li> </ul> </div> </div> </div>
  12. I'm trying to get a value which changes but is always contained the same way this is the text Next: Brigadier (81654 of 220000) as you can see below this is the value i need to get I just can't figure out the RegEx for it? help please! Smaller CODE <div class="rankBar"> <p class="grade"><span id="ctl00_mainContent_identityBar_currentGlobalRankLabel" class="current">Colonel Grade 3</span><span id="ctl00_mainContent_identityBar_nextGlobalRankLabel" class="future">Next: Brigadier (81654 of 220000)</span></p> <div class="rankMeter"> <div id="ctl00_mainContent_identityBar_rankBarPanel" class="bar" style="width:37%;"> <span></span> </div> </div> FULL CODE <div id="ctl00_mainContent_identityBar_idbarPanel"> <div class="glowBox idRankContainer"> <div class="corner bottomLeft"></div> <div class="lattice"></div> <div class="content"> <a href="/Stats/Reach/default.aspx?player=l RaH l" id="ctl00_mainContent_identityBar_avatar" class="avatar"><img id="ctl00_mainContent_identityBar_emblemImg" src="/Stats/emblem.ashx?s=70&0=0&1=0&2=0&3=0&fi=0&bi=0&fl=0&m=3" style="height:70px;width:70px;border-width:0px;"></a> <div class="idRank"> <div class="userInfo"> <img id="ctl00_mainContent_identityBar_namePlateImg" class="img_plate" src="/images/reachstats/nameplates/512.png" alt="" style="height:30px;width:60px;border-width:0px;"> <a href="/projects/reach/article.aspx?ucc=faq&cid=28756"><img id="ctl00_mainContent_identityBar_currentGlobalRankImage" title="Colonel Grade 3" class="img_rankIcon" src="/images/reachstats/grades/med/A4BF62C6-1E3F-468A-9A73-8237600B2AD3.png" alt="Colonel Grade 3" style="height:40px;width:40px;border-width:0px;"></a> <h2><a href="/Stats/Reach/default.aspx?player=l RaH l" id="ctl00_mainContent_identityBar_gamerTag">l RaH l</a> - FLIR</h2> </div> <div class="rankBar"> <p class="grade"><span id="ctl00_mainContent_identityBar_currentGlobalRankLabel" class="current">Colonel Grade 3</span><span id="ctl00_mainContent_identityBar_nextGlobalRankLabel" class="future">Next: Brigadier (81654 of 220000)</span></p> <div class="rankMeter"> <div id="ctl00_mainContent_identityBar_rankBarPanel" class="bar" style="width:37%;"> <span></span> </div> </div> </div> </div> </div> </div> <div class="glowBox shields"> <div class="corner topRight"></div> <div class="lattice"></div> <div class="content"> <ul> <li class="campaign"> <p>Campaign</p> <img id="ctl00_mainContent_identityBar_spCampaignImage" title="Completed Legendary Difficulty" alt="Campaign Progress" src="/images/reachstats/campaign_progress/legendary.png" style="height:59px;width:54px;border-width:0px;"> </li> <li class="coop"> <p>Co-op</p> <img id="ctl00_mainContent_identityBar_coopCampaignImage" title="Completed Normal Difficulty" alt="Coop Campaign Progress" src="/images/reachstats/campaign_progress/normal.png" style="height:59px;width:54px;border-width:0px;"> </li> <li class="arena_display"> <p>Arena</p> <a id="ctl00_mainContent_identityBar_arenaLink" href="/stats/reach/careerstats/playlists.aspx?player=l RaH l&vc=2"><img id="ctl00_mainContent_identityBar_currentBestArenaDivisionImg" alt="" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"></a> <div class="glowBox popOut po_arenaSeason2"> <div class="corner topRight"></div> <div class="corner bottomLeft"></div> <div class="content"> <h4>Arena Season 6</h4> <div class="twoColumn"> <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_arenaImage" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"> <h5>Doubles Arena</h5> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_divisionName">Not Qualified Yet</p> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_lastSeasonControl">Last Season: <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl00_lastSeasonImage" src="/images/reachstats/arena_div/0.png" style="height:23px;width:23px;border-width:0px;"> </p> </div> <div class="rule_transparent"></div> <div class="twoColumn"> <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_arenaImage" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"> <h5>FFA Arena</h5> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_divisionName">Not Qualified Yet</p> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_lastSeasonControl">Last Season: <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl02_lastSeasonImage" src="/images/reachstats/arena_div/0.png" style="height:23px;width:23px;border-width:0px;"> </p> </div> <div class="rule_transparent"></div> <div class="twoColumn"> <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_arenaImage" src="/images/reachstats/arena_div/0.png" style="height:47px;width:48px;border-width:0px;"> <h5>Team Arena</h5> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_divisionName">Not Qualified Yet</p> <p id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_lastSeasonControl">Last Season: <img id="ctl00_mainContent_identityBar_arenaRepeater_ctl04_lastSeasonImage" src="/images/reachstats/arena_div/0.png" style="height:23px;width:23px;border-width:0px;"> </p> </div> </div> </div> </li> </ul> </div> </div> </div>
  13. Alight, I'm trying to figure out the error string for an api http://www.haloreachapi.net/wiki/API_rate_limits The wiki says the limit is 300rpm I tried to run this in two tabs on my browser still won't give me the error string, how can it be done faster? P.s. Api key will be changed in the near future don't waste your time.. <?php $gamertag = "l RaH l"; $url = "http://www.bungie.net/api/reach/reachapijson.svc/game/metadata/30cRxVA9J73esG388CzmOXUVRo5VjYhSfI2qBaqcMzs="; $t_start = microtime(true); for($i = 0; $i < 301; $i++) { $file = file_get_contents($url); echo "Iteration ".($i + 1)."<br>\n"; } $exectime = microtime(true) - $t_start; echo "Execution time: " . round($exectime, 4) . "<br><br>\n\n"; $json = json_decode($file, 1); print_r($json); ?>
  14. My script is not acting like it should. I believe its because of the recent change in the api, (the new error array)? Before there was only one.... <?php $gamertag = 'l RaH l'; $url = "http://api.xboxleaders.com/user_api.php?gamertag=".str_replace(' ', '%20', $gamertag); $output = file_get_contents($url); // try to convert the response into a PHP object $obj = json_decode($output); if(!is_object($obj)) die("Error parsing JSON response\n"); //define variables $avatar = ($obj->user->avatar); $gold = ($obj->user->gold); print $avatar; print $gold; ?> if you print_r $object; it displays this {"error":{"code":200,"desc":"OK"}},{"user":{"gold":1,"gamertag":"l RaH l","avatar":"http:\/\/avatar.xboxlive.com\/avatar\/l%20RaH%20l\/avatarpic-l.png","gamerscore":12508,"reputation":20},"recent_games":[{"recent_game":{"title":"Halo: Reach","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1297287259&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/ih\/ew\/0Wdsb2JhbA9ECgR8GgMfVlohL2ljb24vMC84MDAwIAAAAAAAAP6fF5U=.jpg"}},{"recent_game":{"title":"Halo 3","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1297287142&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/Us\/3e\/1Wdsb2JhbA9ECgR8GgMfWSpVL2ljb24vMC84MDAwIAAAAAAAAPrxzU0=.jpg"}},{"recent_game":{"title":"AC Brotherhood","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1431504989&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/oK\/tp\/1Wdsb2JhbA9ECgUNGgMfVlonL2ljb24vMC84MDAwIAAAAAAAAPpGq78=.jpg"}},{"recent_game":{"title":"Fighters Uncaged","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1431504974&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/v+\/Au\/0Wdsb2JhbA9ECgUNGgMfVlsmL2ljb24vMC84MDAwIAAAAAAAAP4B4KA=.jpg"}},{"recent_game":{"title":"Assassin's Creed","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1431504852&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/L3\/mu\/0Wdsb2JhbA9ECgUNGgMfWStXL2ljb24vMC84MDAwIAAAAAAAAP6BeTA=.jpg"}}]}
  15. Please somebody actual take a look at this It like to different parent Arrays i guess, no clue how to access the second one this is what the $output prints: {"error":{"code":200,"desc":"OK"}}{"user":{"gold":1,"gamertag":"l RaH l","avatar":"http:\/\/avatar.xboxlive.com\/avatar\/l%20RaH%20l\/avatarpic-l.png","gamerscore":12508,"reputation":20},"recent_games":[{"recent_game":{"title":"Halo: Reach","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1297287259&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/ih\/ew\/0Wdsb2JhbA9ECgR8GgMfVlohL2ljb24vMC84MDAwIAAAAAAAAP6fF5U=.jpg"}},{"recent_game":{"title":"Halo 3","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1297287142&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/Us\/3e\/1Wdsb2JhbA9ECgR8GgMfWSpVL2ljb24vMC84MDAwIAAAAAAAAPrxzU0=.jpg"}},{"recent_game":{"title":"AC Brotherhood","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1431504989&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/oK\/tp\/1Wdsb2JhbA9ECgUNGgMfVlonL2ljb24vMC84MDAwIAAAAAAAAPpGq78=.jpg"}},{"recent_game":{"title":"Fighters Uncaged","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1431504974&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/v+\/Au\/0Wdsb2JhbA9ECgUNGgMfVlsmL2ljb24vMC84MDAwIAAAAAAAAP4B4KA=.jpg"}},{"recent_game":{"title":"Assassin's Creed","link":"http:\/\/gamercard.xbox.com\/en-US\/GameCenter\/Achievements?titleId=1431504852&compareTo=l%20RaH%20l","image":"http:\/\/tiles.xbox.com\/tiles\/L3\/mu\/0Wdsb2JhbA9ECgUNGgMfWStXL2ljb24vMC84MDAwIAAAAAAAAP6BeTA=.jpg"}}]}
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.