SimpleSi Posted November 19, 2009 Posted November 19, 2009 My brother came up with a little plan for a X Factor voting app and Im working on the coding but wondered if anyone else had made one and was willing to answer a few questions about using FBML calls in an Iframe app. regards Simon
webman Posted November 19, 2009 Posted November 19, 2009 I did start on one but I don't have access to any of the code at the moment I'm afraid. What's your query?
SimpleSi Posted November 19, 2009 Author Posted November 19, 2009 Like I say - no FB javascript calls seem to do anything at all. I've worked around it (main problem was getting app to ask for publishing permission) - all examples are using fb: type calls (which do nothing and mean nothing to me ) I'd just like to find out what I'm doing wrong For example of code that does nothing :- // Copyright 2007 Facebook Corp. All Rights Reserved. // // Application: The W Factor - Rate the X factor contestants // File: 'index.php' // This is a sample skeleton for your application. // require_once 'facebook.php'; $appapikey = 'xxxx'; $appsecret = 'yyy'; $facebook = new Facebook($appapikey, $appsecret); $user_id = $facebook->require_login(); // Greet the currently logged-in user! echo " Hello, !"; echo ""; The does nothing - no error just no output at all This is the sample code that facebook itself offers when developing apps regards Simon
Dodgex1 Posted November 20, 2009 Posted November 20, 2009 I had a go at one, It might be not be much help, I used this when I was playing about I can has Facebook - .net magazine
Edu-IT Posted November 20, 2009 Posted November 20, 2009 I know somebody who has and I can put you in touch with them later today if you like? Drop me your email address if you're interested and if you have MSN, they're always on that.
mossj Posted November 20, 2009 Posted November 20, 2009 Theres an example app on facebook (snowglobe or snowman) anyway it's basicly a hello world app. could well be worth a look.
SimpleSi Posted November 21, 2009 Author Posted November 21, 2009 Thanks for offers but I think I've managed to nail the little sucker If your really really bored and got absolutely nothing else (and I mean nothing else to do then visit http://apps.fcaebook.com/simplesi delib misspull to stop spiders and see if if works for you - reports welcome it should post a barchart to your status - to remove it just goto your profile and you can remove it from their. I'd just like to say it was my brother's idea and I just did the programming! regards Simon
SimpleSi Posted November 27, 2009 Author Posted November 27, 2009 I'm having a slight problem with a delay now. The app displays a voting table and has a vote button to submit the form. I then do some calculations and work out totals. I then get PHP to make a bar chart of the results and then post the information onto users wall. The problem is that there can be a long delay (30 secs) with last step so I put another form in to pause the workflow and output the results onto screen and then added another button to go back to view wall - this submit button then did the posting of results before redirecting to home page. Problem is that some users don't click the button - they directly click their own Home button so the status update doesn't happen. Basically I'm fighting HTML/PHP workflow that wants to process whole of script before outputing any info onto webpage (and if I output info I can't of course do a Header: Location redirect ) Anyone had this sort of issue and got any workarounds regards Simon
PaulBM Posted November 27, 2009 Posted November 27, 2009 I suppose the obvious solution would be to try to optimise the script to reduce the 30 second delay. What's the cause of the delay?
SimpleSi Posted November 28, 2009 Author Posted November 28, 2009 I'm trying to insert some echo time statements to see where the delays are - but the very fact of inserting them seems to have speeded the app up I wonder if its just random load on either my server (which is just a shared one hosted on one.com) or facebook regards Simon
PaulBM Posted November 28, 2009 Posted November 28, 2009 Is the Net tab in Firebug any good to you to spot the delay? It gives timings of all the requests for the page. It may show if facebook is the cause. 1
SimpleSi Posted November 29, 2009 Author Posted November 29, 2009 I looked to installing firebug but it looks too complex for me with all the server side that's needed My brother (Project leader ) came up with a little bit of Javascript code that displays a "wait while we calculate your scores" box which keeps the users happy while the processing is going on The delays seemed to def be when I use facebook api to update users status - it can vary quite a bit in how long this takes (1 - 20 secs ) My main problem turned out to be when I asked someone new to test it and they used IE Practically nothing worked - main problem being that IE wouldn't automatically hold facebook parameters (user id etc) across subsequent redirects to other php files Ended up having to collect all params on first file and re-add them as url parameters on subsequent redirects. Only found this out at about 2pm Sat but managed to get it working before show start! Now I've to start and implement the app keeping track of everyones score and handing out the running totals after each user has voted. We are up to 26 users - at least two of these people aren't actually friends or family regards Simon
PaulBM Posted November 29, 2009 Posted November 29, 2009 Excellent news. We should have guessed IE would be the cause. By the way, Firebug is a Firefox addon, I didn't make myself clear in the previous post. It's a vital addon for web developers everywhere. Firebug - Web Development Evolved Here's a link to the Net tab... Firebug and Network Monitoring I'd love to test your app, only trouble is I'd need to be paid serious money to watch X-Factor.
SimpleSi Posted November 30, 2009 Author Posted November 30, 2009 Thanks - I was getting confused between FirePHP and FireBug DIdn't know FireBug could profile times - ta very much regards Simon
ahuxham Posted November 30, 2009 Posted November 30, 2009 Thanks - I was getting confused between FirePHP and FireBug DIdn't know FireBug could profile times - ta very much regards Simon Google Chrome has a built-in inspector that catalogues times, including documents, stylesheets, server response, scripts and processing, invaluable tool to have Right click on page > Inspect Element > Resources and its all there, just refresh and new times are shown. Edugeek reply to post is showing 541ms Documents, 324ms Images, 315ms Scripts, 139ms Other
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now