Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Dashboard Movies Widget suddenly not working

The built-in Movies widget from Apple (that shows movie posters as a slide show on one side and theaters/times on the other side) has suddenly stopped working. I tried to quit and reopen from Dashboard, move the widget out of the main library's widget folder, reinstalling by double clicking on it, removing preferences, deleting system cache, history, repairing permissions, copying the widget from another computer: nothing worked.


The rounded rectangular window simply shows "No movie data available" and clicking on it does not make it flip as it normally should. Therefore, it is just sitting there on the dashboard, not showing anything other than the sentence above, and cannot be customized. I can open several of these Movies widgets simultaneously and none works nor flips.


I cannot think of anything that might have made it stop working (my internet is OK, not a firewall issue). Any suggestion would be appreciated.


Thanks.

MacBook Air + iMac-OTHER, Mac OS X (10.6.8)

Posted on Oct 21, 2011 4:27 PM

Reply
93 replies

Nov 2, 2011 5:39 AM in response to Topher Kessler

i have modified the file as stated in article

but its NOT working, could someone please post working file?

my file below

var _gLastMovieDataFetchDate;



function markLastMovieDataFetchDate() {

_gLastMovieDataFetchDate = new Date();

}



// return true if midnight (local time) has passed since data was last fetched

function getShouldFetchNewMovieData() {

if (!_gLastMovieDataFetchDate) {

return true;

}

// getDate() returns day of month as number

var midnightHasPassedSinceLastFetch = (new Date().getDate() != _gLastMovieDataFetchDate.getDate());

return midnightHasPassedSinceLastFetch;

}



function markShouldFetchNewData() {

_gLastMovieDataFetchDate = null;

}



function prepareAsyncGetRequest(url, successCallback) {

Utils.hideElement($("errorMsgBox"));



var req = new XMLHttpRequest();

req.onload = function(evt) {successCallback(evt, req)};

req.onerror = onHttpError;

url = encodeURI(url);

req.open("GET", url, true);

req.overrideMimeType("text/xml");

req.setRequestHeader("Cache-control","No-cache");

req.setRequestHeader("Pragma","No-cache");

return req;

}



function onHttpError(evt) {

alert("Error occured while loading data: " + evt.target.status);

handleNetworkError();

}



function handleNetworkError() {

alert("MOVIES NETWORK ERROR");

Utils.hideElement($("posterWrap"));

if (!isInCompactView()) {

showingErrorMsgBox = true;

setTimeout(showErrorMsgBox, 2000);

shrinkWidget();

} else if (!showingErrorMsgBox) {

showingErrorMsgBox = true;

showErrorMsgBox();

}

}



function handleNoMovieDataAvailable() {

alert("NO MOVIE DATA AVAILABLE");

if (isInCompactView()) {

resizePhase1();

} else{

setTimeout(showBack, 600);

setTimeout(function () {

showMenuItem(getLocalizedString("No movie data available"));

}, 1300);

}

}



var showingErrorMsgBox;



function showErrorMsgBox() {

var errorMsgBox = $("errorMsgBox");

errorMsgBox.innerHTML = getLocalizedString("No movie data available");

Utils.hideElement($("posterWrap"));

Utils.showElement(errorMsgBox);

markShouldFetchNewData();

showingErrorMsgBox = false;

}



// returns either "&op=performancesbycitystatesearch&city=sunnyvale&state=ca"

// or "&op=performancesbypostalcodesearch&postalcode=94087"

function getMethodAndLocationQueryStringFragment() {

var location = getLocation();

if (isValidPostalCode(location)) {

return "&op=performancesbypostalcodesearch&postalcode=" + location;

} else {

var index = location.indexOf(",");

var city = Utils.trimWhiteSpace(location.substring(0, index));

var state = location.substring(index+1);

if (state && state.length) {

state = Utils.trimWhiteSpace(state);

} else {

state = "";

}

return "&op=performancesbycitystatesearch&city=" + city + "&state=" + state;

}

}



var _gWaitingForMoviesDataToLoad;



function fetchAllData() {

if (!getShouldFetchNewMovieData()) {

// skip fetching data and go to end of callback

afterAllDataFetched();

} else {

_gWaitingForMoviesDataToLoad = false;

fetchMoviesData();

fetchAppleResourceUrlData();

}

}



function fetchMoviesData() {

if (fetchMoviesData.req) {

fetchMoviesData.req.abort();

fetchMoviesData.req = null;

}



var url = "http://www.fandango.com./"

+ getDate() + getMethodAndLocationQueryStringFragment();


var req = prepareAsyncGetRequest(url, moviesDataFetched);

fetchMoviesData.req = req;

markLastMovieDataFetchDate();

req.send(null);



initAllMoviesTable();

initAllTheatersTable();

}



function moviesDataFetched(evt, req) {

var doc;

try {

doc = req.responseXML;

if (!doc || !doc.documentElement) {

handleNetworkError();

return;

}


var err = parseMovies(doc);

if (err) return;

err = parseTheaters(doc);

if (err) return;


if (_gWaitingForMoviesDataToLoad) {

parseAppleResourceUrlData();

}

} catch (e) {

alert("Runtime Error: " + e);

// handle missing network connection or no vendor data

handleNoMovieDataAvailable();

} finally {

req = doc = null;

}

}



function parseMovies(doc) {

var movieEls = doc.getElementsByTagName("movie");

var movie;

if (!movieEls || !movieEls.length) {

handleNoMovieDataAvailable();

return -1;

}

for (var i = 0; i < movieEls.length; i++) {

movie = movieObjectForMovieElement(movieEls[i]);

allMoviesTable[movie.id] = movie;

}

allMoviesList = getSortedArrayForTable(allMoviesTable);

return 0;

}



function parseTheaters(doc) {

var theaterEls = doc.getElementsByTagName("theater");

if (!theaterEls || !theaterEls.length) {

handleNoPerformanceDataAvailable();

return -1;

}



var theater, theaterEl;

for (var i = 0; i < theaterEls.length; i++) {

theaterEl = theaterEls[i];

theater = theaterObjectForTheaterElement(theaterEl);

consumePerformanceDataForTheater(theater, theaterEl);

theater.movies.sort(comparatorFunction);

allTheatersTable[theater.id] = theater;

}

allTheatersList = getSortedArrayForTable(allTheatersTable);

for (var id in allMoviesTable) {

allMoviesTable[id].theaters.sort(comparatorFunction);

}



if (!currentTheaterId) {

currentTheaterId = allTheatersList[0].id;

}

return 0;

}



var _gAppleResourceUrlDoc;



function fetchAppleResourceUrlData() {

_gAppleResourceUrlDoc = null;

if (fetchAppleResourceUrlData.req) {

fetchAppleResourceUrlData.req.abort();

fetchAppleResourceUrlData.req = null;

}

var url = "http://www.apple.com/trailers/home/xml/widgets/indexall.xml" ;

var req = prepareAsyncGetRequest(url, appleResourceUrlDataFetched);

fetchAppleResourceUrlData.req = req;

req.send(null);

}



function appleResourceUrlDataFetched(evt, req) {

_gAppleResourceUrlDoc = req.responseXML;

if (!allMoviesList) {

_gWaitingForMoviesDataToLoad = true;

} else {

parseAppleResourceUrlData();

}

}



function parseAppleResourceUrlData() {

posterMovieIds = [];

var doc;

var id, movie;

try {

doc = _gAppleResourceUrlDoc;

var movieInfoEl;

var posterEls;

var previewEls;

var movieInfoEls = doc.getElementsByTagName("movieinfo");


for (var i = 0; i < movieInfoEls.length; i++) {

movieInfoEl = movieInfoEls[i];

id = movieInfoEl.getAttribute("fandangoid");

movie = allMoviesTable[id];

if (movie) {

consumeResourceUrlDataForMovie(movieInfoEl, movie);

movie.complete = true;

posterMovieIds.push(id);

}

}

} catch (e) {

// ignore. if there's no poster or trailer resources, no biggie.

} finally {

req = null;

doc = null;

_gAppleResourceUrlDoc = null;

afterAllDataFetched();

}

}



function afterAllDataFetched() {

if (isInCompactView()) {

var posterUrl = kDefaultPosterUrl;

if (posterMovieIds && posterMovieIds.length) {

posterIndex = randomIntegerZeroToNInclusive(posterMovieIds.length);

posterUrl = allMoviesTable[posterMovieIds[posterIndex]].posterUrl;

}

poster1.src = posterUrl;

poster2.src = posterUrl;

startPosterFadeAnimationLoop();

addPosterClickedEventListener();

} else {

displayAllMovieInfo();

}

}



function getTicketPurchasePageUrl(movieId, theaterId, time) {

//"07-18-2007+22:25"

// must create this format string. create lazily here, rather than during initial response parsing.

var len = time.time.length-2;

var isPM = ("pm" == time.time.substring(len));

var timeStr = time.time.substring(0, len);

var indexOfColon = timeStr.indexOf(":");

var hours = parseInt(timeStr.substring(0, indexOfColon), 10);

var mins = timeStr.substring(indexOfColon);

if (isPM) {

if (hours < 12) {

hours += 12;

timeStr = hours + mins;

}

} else if (hours == 12) {

timeStr = "00" + mins;

}

var dateStr = time.date.replace(/\//g, "-");

var url = "http://www.fandango.com./" + movieId

+ "&a=11617&tid=" + theaterId

+ "&dte=0&date=" + dateStr

+ "+" + timeStr;

return url;

}



function validateLocation(location) {

if (validateLocation.req) {

validateLocation.req.abort();

validateLocation.req = null;

}


var locStr = $("locationTextField").value;

var city = "";

var state = "";


var index = locStr.indexOf(",");

if (-1 == index) {

index = locStr.lastIndexOf(" ");

}

if (index > -1) {

city = locStr.substring(0, index);

state = locStr.substring(index+1);

} else {

city = locStr;

}


var url = "http://www.fandango.com./"

+ city + "&state=" + state;


var req = prepareAsyncGetRequest(url, locationValidationFetched);

validateLocation.req = req;

req.send(null);

}



function locationValidationFetched(evt, req) {

var doc = req.responseXML;


var result;

if (!doc || !doc.documentElement) {

result = {error:true};

} else {

var locationEls = doc.getElementsByTagName("location");

result = {error:false, cities:new Array()};



for (var i = 0; i < locationEls.length; i++) {

var locationEl = locationEls[i];

var city = locationEl.getElementsByTagName("city").item(0).textContent;

var state = locationEl.getElementsByTagName("state").item(0).textContent;

result.cities.push({city:city, state:state});

}

}

validationCallback(result);

req = doc = null;

}

Nov 2, 2011 8:03 AM in response to S. G.

So, I commented to the author of the widget fix on CNET that many (including me and my sister) were getting confused and replacing the entire wu.apple.com URL string with http://www.fandango.com and were then having to go back to correct this mistake. I suggested he edit his article to further clarify. He commented in my favor and made the suggested changes. Hopefully users of this widget will be less confused from here on out!

Nov 2, 2011 10:13 AM in response to Fudelinuyasha

Personally, I found the Teminal way to be the easiest.


This is what I did:

Go to Spotlight, type in Terminal. Click on Terminal when it pops up.

Type in Exactly this (copy & paste if you want):


sudo nano /System/Library/WidgetResources/.parsers/moviesParser.js


The Terminal will say:

Password:

Type in your password (you probably have to be logged in under an admin account)

The window will change. It will look black and white. Make sure your cursor is somewhere in that window.

Using your keyboard hit - Control + w (where is command)

type in: wu.apple.com

the "box" cursor will stop on the "w" of the first wu.apple.com

Use your arrow key to get to the end of the wu.apple.com and then your delete key (backspacing) to delete all the letters of wu.apple.com.

Then type in www.fandango.com


I used the Control + w and found 3 of them and replaced all three.


When you have done that, use your keyboard: Control + x (exit command)

It will ask if you want to Save. Yes you want to save.


Then you can also quit the Terminal (you can click the X, or keyboard: Command + q)


Then I logged out and back in (don't know if absolutely necessary, but I did it)


I then started the dashboard and the Movie widget was working. It is still working now.


Hope this helps. I did also have a little trouble at the beginning, I think it was the black and white window which confused me.


(Thanks, Topher!)

Dashboard Movies Widget suddenly not working

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.