Jump to content

Recommended Posts

Hello,

Recently NFl.com has changed their website so now my site will not update to get me the new schedule for 2012. They used to have a drop down but have now changed it by clicking on numberof the weeks. If I were to give you the page of my code could you help me out by telling me what needs to be changed???

 

Please I really need this .....

 

this is the error that it gives me Parse Error

 

Unfortunately, http://www.nfl.com/schedules/2012/REG1 has changed. Please contact emilio and cite page /admin/build_nfl_regular_season_schedule.php with error cannot find newest season year value container <select id="seasonDropdown">

 

Thanks

18678_.php

Link to comment
https://forums.phpfreaks.com/topic/265837-need-help-with-parsing-an-nfl-schedule/
Share on other sites

You need to find all instances in the code like:

 

select[id=seasonDropdown]

 

All of these needs to be changed so that it matches the expected text. To give you an example:

 

$year = trim($schedule->find('ul[class=schedules-nav-dropdown-item-content-ul]', 0)->find('li', 0)->innertext);

 

Would give you the first year in the year dropdown for the new layout. Not tested.

Unfortunately, http://www.nfl.com/schedules/2012/REG1 has changed. Please contact emilio and cite page /admin/build_nfl_regular_season_schedule.php with error cannot find newest season year value container <select id="seasonDropdown">

 

So why don't you?

 

Quote

 

    Unfortunately, http://www.nfl.com/schedules/2012/REG1 has changed. Please contact emilio and cite page /admin/build_nfl_regular_season_schedule.php with error cannot find newest season year value container <select id="seasonDropdown">

 

 

So why don't you?

Because that is my email address.....

I appreciate your help...So can i insert that code that you gave me inot my code and test it?

Can't you just contact the person who wrote this script for you? Maybe he already has an updated version?

 

I appreciate your help...So can i insert that code that you gave me inot my code and test it?

 

Yes, but 1) create a backup first 2) you have to replace ALL instances where they try to retrieve information from the website, which means you'll need some tools which can be found by pressing F12 in Firefox or Chrome to get the developer console.

>> select[id=seasonDropdown] to  >> $year = trim($schedule->find('ul[class=schedules-nav-dropdown-item-content-ul]', 0)->find('li', 0)->innertext);

 

Obviously I refer to the entire line 91:

$year = trim($schedule->find('select[id=seasonDropdown]', 0)->find('option', 0)->innertext);

 

Must be replaced with above mentioned code.

No that person is long gone.....

 

so this

* <select id="season"> structure integrity detection. */

if (count($schedule->find('select[id=seasonDropdown]', 0)) == 0) {

nfl_site_changed("cannot find newest season year value container <select id=\"seasonDropdown\">");

}

 

becomes this

* <select id="season"> structure integrity detection. */

if (count($schedule->find('$year = trim($schedule->find('ul[class=schedules-nav-dropdown-item-content-ul]', 0)->find('li', 0)->innertext);

}

Obviously I refer to the entire line 91:

$year = trim($schedule->find('select[id=seasonDropdown]', 0)->find('option', 0)->innertext);

 

Must be replaced with above mentioned code.

 

If you feel uncomfortable making these changes then you can always head on over to the freelancing section and let someone make these changes for you.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.