Jump to content

smithmr8

Members
  • Posts

    199
  • Joined

  • Last visited

    Never

Everything posted by smithmr8

  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..
  16. Hi, Have a project, http://ziz.im URL Shortener. For some reason, shortened youtube links don't work. When used, they go to the youtube page, displaying a message saying the video is not available. But it's the same link (once redirected) as the original link. Any idea what could be causing this ?
  17. That'll teach me to read things properly! Thanks, works fine. It was because I was trying to include a file. Just copied the contents in and working fine.
  18. Hi, Working on a URL re-direction site. http://ziz.im At the moment, it's not using the most effecient of redirections. I want to change this to a 301 redirect. But I can't quite figure out how to get it to work. Currently: - I am using a .htaccess rewrite to re-direct all shortened urls to a page (parse.php) which is providing the public variable 'q' containing the shortened keywork (e.g. GTRfdrtlls). - This is then checked through the DB to find if its valid, then redirects to that URL. How can I get it to use 301 Redirects, like the below: <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.new-url.com" ); ?> I need to be able to query the database to get the URL / Check if its valid before I can specify the URL. But you need to specify the headers at the start. Confused. Cheers.
  19. Thanks. Found what I needed, and the core element is working perfectly. Thanks for the help / point in the right direction.
  20. Hi, Not quite sure how to explain this in technical terms, but basically what I want to be able to do is allow a user to enter a url like: thisurl.co.uk/UF55fg3 And I am then able to retrieve the value "UF55fg3" in the index page. Like the URL shorteners do. Not sure how to do it though. Cheers.
  21. I need it for each day singularly, but can modify that. Much appreciated. Will give it a go.
  22. Hi, I want to be able to generate visitor statistics for a blog I'm creating. I'm going to be collecting numerous pieces of data when a post is viewed, including a time stamp of the visit. I need to be able to select timestamps that were within the current day, the previous day, the day before that ect.. So that I can generate the statistics. Show it for the current week (current day and 6 previous days). So it would be the entries where the timestamp was made on the days: 11/1, 10/1, 9/1, 8/1, 7/1, 6/1, 5/1. For example. Not quite sure how I could do this. Thanks.
  23. Yeah, I'm aware of that one. But when I remove that script from the site, it still doesn't let the image-over script work. So I don't think that's affecting is.
  24. Hi, http://bit.ly/c6qEdC This site is working perfectly in Firefox. However, for an unknown reason, its not working correctly in IE. The menu isn't working properly, no drop-down links. The image at the bottom, the text to the left of the image is supposed to change when you hover over the respective categories. Any idea why it isn't working ? It doesn't work at all in my IE. I've ran it through browserspot, and it seems to work alright in their, from what I can see. I've asked some other people to run it, and it works. Any idea what might be causing the problem, and how to solve it. It used to work, but no-longer seems to. Cheers.
×
×
  • 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.