Jump to content

smithmr8

Members
  • Posts

    199
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

smithmr8's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Evening, I'm attempting to get the 'Sign in with twitter' option working. You can view the code here: https://gist.github.com/2979612 It takes me to Twitter. Asks me to authorise the application. It then redirects back to my localhost, with the two parameters oauth_token and oauth_verifier defined within the URL. But the page shows a 401 error when trying to retrieve the access_token. Any ideas ? I've tried this in so many ways its just starting to annoy me now.
  2. Thanks. Some trial and error landed me with this method: $.each(response["results"], function(){ var objects = $(this); var from_user = objects[0]["from_user"]; ... });
  3. Hi, I'd like to be able to loop through a JSON object like the one below in Javascript (via jQuery if applicable). {"completed_in":0.117,"max_id":146692852720746500,"max_id_str":"146692852720746496","next_page":"?page=2&max_id=146692852720746496&q=Luke&lang=en&rpp=2","page":1,"query":"Luke","refresh_url":"?since_id=146692852720746496&q=Luke&lang=en","results":[{"created_at":"Tue, 13 Dec 2011 20:47:56 +0000","from_user":"Santo4osu","from_user_id":283539563,"from_user_id_str":"283539563","from_user_name":"Gregg Santomieri","geo":null,"id":146692852720746500,"id_str":"146692852720746496","iso_language_code":"en","metadata":{"result_type":"recent"},"profile_image_url":"http://a2.twimg.com/profile_images/1585743932/image_normal.jpg","source":"<a href="http://twitter.com/">web</a>","text":"RT @CFBLive: #OhioState HC Urban Meyer said Luke Fickell will make the defensive calls in 2012 & have defensive coordinator in his title","to_user":null,"to_user_id":null,"to_user_id_str":null,"to_user_name":null},{"created_at":"Tue, 13 Dec 2011 20:47:49 +0000","from_user":"BertieBertGLove","from_user_id":332798835,"from_user_id_str":"332798835","from_user_name":"Bertie Gilbert Fans ","geo":null,"id":146692826044973060,"id_str":"146692826044973057","iso_language_code":"en","metadata":{"result_type":"recent"},"profile_image_url":"http://a3.twimg.com/profile_images/1647366588/bbgl2__2__normal.jpg","source":"<a href="http://twitter.com/#!/download/iphone" rel="nofollow">Twitter for iPhone</a>","text":"RT @Bertwg97: Guys I got mugged ages ago. I was just commenting on luke's tweet.","to_user":null,"to_user_id":null,"to_user_id_str":null,"to_user_name":null}],"results_per_page":2,"since_id":0,"since_id_str":"0"} It's the "result" array or object that I need to loop through to get access to the information inside each result object. How would I achieve this ? Thanks, Luke.
  4. I've got a selection of data helds in a number of arrrays. e.g. : Array ( [projects] => Array ( [project] => Array ( [0] => Array ( [id] => 316431 [name] => My Sample Project [iteration_length] => 1 [week_start_day] => Monday [point_scale] => 0,1,2,3 [account] => Luke [first_iteration_start_time] => 2011/06/06 07:00:00 UTC [current_iteration_number] => 3 [enable_tasks] => true [velocity_scheme] => Average of 3 iterations [current_velocity] => 8 [initial_velocity] => 10 [number_of_done_iterations_to_show] => 12 [labels] => admin,blog,cart,checkout,deployment,design,epic,featured products,ie6,needs discussion,orders,reporting,search,shopper accounts,shopping,signup / signin,usability,user generated content [allow_attachments] => true [public] => false [use_https] => false [bugs_and_chores_are_estimatable] => false [commit_mode] => false [memberships] => Array ( [membership] => Array ( [id] => 1002639 [person] => Array ( [email] => smithmr8@hotmail.co.uk [name] => Luke [initials] => LU ) [role] => Owner ) ) [integrations] => Array ( ) ) [1] => Array ( [id] => 316459 [name] => Testing [iteration_length] => 1 [week_start_day] => Monday [point_scale] => 0,1,2,3 [account] => Luke [first_iteration_start_time] => 2011/06/19 23:00:00 UTC [current_iteration_number] => 1 [enable_tasks] => true [velocity_scheme] => Average of 3 iterations [current_velocity] => 10 [initial_velocity] => 10 [number_of_done_iterations_to_show] => 12 [labels] => Array ( ) [last_activity_at] => 2011/06/22 10:23:31 UTC [allow_attachments] => true [public] => false [use_https] => false [bugs_and_chores_are_estimatable] => false [commit_mode] => false [memberships] => Array ( [membership] => Array ( [id] => 1002745 [person] => Array ( [email] => smithmr8@hotmail.co.uk [name] => Luke [initials] => LU ) [role] => Owner ) ) [integrations] => Array ( ) ) ) ) ) I need to be able to loop through the projects which are returned. I can get the data from each array manually, by doing (for example): To get the ID for the second project: $projects["projects"]["project"]["1"]["id"]; Is there any way I can loop through the projects, and list out the attributes of each project individually. ie. Display ID, name ect.. for #0 THEN Display ID, name ect.. for #1 And then continue if there are more than two projects.. Cheers.
  5. How would you go about seperating the projects within this structure ? Array ( [projects] => Array ( [project] => Array ( [id] => 316431 [name] => My Sample Project [iteration_length] => 1 [week_start_day] => Monday [point_scale] => 0,1,2,3 [account] => Luke [first_iteration_start_time] => 2011/06/06 07:00:00 UTC [current_iteration_number] => 3 [enable_tasks] => true [velocity_scheme] => Average of 3 iterations [current_velocity] => 8 [initial_velocity] => 10 [number_of_done_iterations_to_show] => 12 [labels] => admin,blog,cart,checkout,deployment,design,epic,featured products,ie6,needs discussion,orders,reporting,search,shopper accounts,shopping,signup / signin,usability,user generated content [allow_attachments] => true [public] => false [use_https] => false [bugs_and_chores_are_estimatable] => false [commit_mode] => false [memberships] => Array ( [membership] => Array ( [id] => 1002639 [person] => Array ( [email] => smithmr8@hotmail.co.uk [name] => Luke [initials] => LU ) [role] => Owner ) ) [integrations] => Array ( ) ) ) ) Would like to be able to seperate each project, and then detail each project and it's respective attributes individually Any ideas ?
  6. Ah, I've never used alot of PHP OO, so that's a great help. I'll have a play and see what I can come up with. Much appreciated!
  7. Hi, Trying to get an API to work with PHP. Have found the following code: https://github.com/auzigog/php_pivotal_tracker/blob/master/pivotaltracker_rest.php Unable to get it to work, after filling in my credentials. Try to run a function, and just get told it's undefined. ect.. How, and where, would I run the functions specified in those classes ? Cheers.
  8. Excellent. Thank-you very much!
  9. That returns this: SimpleXMLElement Object ( [@attributes] => Array ( [server_time] => 2011-05-31T19:45:34Z ) [bookList] => SimpleXMLElement Object ( [@attributes] => Array ( [total_results] => 1 [page_size] => 10 [page_number] => 1 [shown_results] => 1 ) [bookData] => SimpleXMLElement Object ( [@attributes] => Array ( [book_id] => build_your_own_database_driven_web_site_using_php_mysql_4th_ [isbn] => 0980576814 [isbn13] => 9780980576818 ) [Title] => Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition [TitleLong] => SimpleXMLElement Object ( ) [AuthorsText] => Kevin Yank, [PublisherText] => SitePoint [Details] => SimpleXMLElement Object ( [@attributes] => Array ( [change_time] => 2009-04-02T00:30:10Z [price_time] => 2011-05-31T17:46:10Z [edition_info] => Paperback; 2009-06-15 [language] => [physical_description_text] => 360 pages [lcc_number] => [dewey_decimal_normalized] => 5 [dewey_decimal] => 005 ) ) ) ) ) What would I have to do to get it to echo out the title, and such ? Not sure how you'd go about doing that from this.
  10. Hi, I need to get data from an XML file, like the format below: <ISBNdb server_time="2011-05-31T19:19:42Z"> <BookList total_results="1" page_size="10" page_number="1" shown_results="1"> <BookData book_id="build_your_own_database_driven_web_site_using_php_mysql_4th_" isbn="0980576814" isbn13="9780980576818"> <Title> Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition </Title> <TitleLong/> <AuthorsText>Kevin Yank, </AuthorsText> <PublisherText publisher_id="sitepoint">SitePoint</PublisherText> <Details change_time="2009-04-02T00:30:10Z" price_time="2011-05-31T17:46:10Z" edition_info="Paperback; 2009-06-15" language="" physical_description_text="360 pages" lcc_number="" dewey_decimal_normalized="5" dewey_decimal="005"/> </BookData> </BookList> </ISBNdb> I need to know how you get the details from <title>,<AuthorsText><PublisherText> and Bookdata. Tried using the example on W3C, using simplexml_load_file but it only returns: ISBNdb BookList: Code I'm currently using is: $xml = simplexml_load_file("http://isbndb.com/api/books.xml?access_key=----&results=details&index1=isbn&value1=".$isbn); echo $xml->getName() . "<br />"; foreach($xml->children() as $child) { echo $child->getName() . ": " . $child . "<br />"; }
  11. I'm building a classified website, aimed specifically at books. Is there any frameworks / plugins I can integrate with the code of the site to send the ISBN number and get book details (Name, author, category ect.. )
  12. Yeah, that would work. But I need the 301 redirect. Most efficient type of redirection. I'll just use the server stats. It'll be fine :-P
  13. It's a URL shortening service. So the target pages aren't mine. Which is my conundrum. I can get stats via the server. Was just wondering if I could add google analytics to the redirect script so I could get some analytics on it. Bit of a long shot. ;-)
  14. I've got a page which has a 301 Redirect. Is there anyway to put the google analytics tracking codes on the page ? I've tried, but because its output, it doesn't work before the 301 Header Redirect. Don't think there is, but worth a try. Cheers.
  15. Apologies. I was formatting the URL to lower case, which conflicted with the variance in youtube identifiers. Pfft. Is there any good scripts for verifying a URL is valid ? Checks if has http, www, ect..
×
×
  • 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.