This is comment page 3 for Creating a Custom jQuery Twitter Feed (API v1.1) »
Authenticating a Twitter Feed for OAuth API V1.1 – Timelines & streams »
Twitter feed authentication (API 1.1) for search »
Creating a Twitter Search & Analytics tool »
I am having a weird issue. I keep getting a popup that says:
“parsererror – SyntaxError: JSON.parse: unexpected character”
and I cannot find the source of the problem. Any suggestions? I am building the site at the following address: new.semoelite.com
Hey I got my script working with my site. Now I have another question. How hard would it be to incorporate jcarousel lite into the .js file and make the tweets auto scroll?
Please check below link I Used your toturial and I think I’m also done but getting a popup error :/ don’t know why will you please check tell me my mistake.
Thanks and really great work
Hi Tom,
I’ve got everything working and the tweets displaying now, except I’m getting some strange jQuery error. The error message is this:
“object Object],[object Object],….,[object Object],[object Object]”
Every time I refresh the page it pops up. Could you help me out please?
Many thanks.
Hello Tom I recently posted on another post and mentioned that my get-tweets1.1.php wasn’t displaying tweets in json format.
Thanks to you I ended up getting it to work
Screenshot here//
http://i44.tinypic.com/281zexu.png
My new issue is the tweets on my website aren’t displayed at all. I viewed the source code and the “twitter-feed” div is there but empty…
I have twitterfeed.js & twitterfeed.css in my header//
http://i39.tinypic.com/dbasz.png
and changed both:
twitterprofile = “keihead”;
screenname = “keihead”;
as well as the $getJSON url to//
example[dot]com/test/get-tweets1.1.php
but as I said before the div remains empty…
Please help me get this working >.<
Hi Tom,
Thanks for this very nice tutorial!
Unfortunately I get a ‘No Transport’-error when I upload the Twitter feed to the hosting company of my client. Locally on my Qnap NAS webserver it works fine.
I found that the ‘No Transfer’-error has to do with cross domain boundaries and that I should use JSONP in stead of JSON. I’ve added a callback function to the connection->get statement, but that didn;t work.
I’ve also tried to set jQuery.support.cors = true; to allow cross domain browsing, but then I got something like ‘Not Allowed’.
Can you help me with this?
I’ve added an absolute path to get-tweets1.1.php in twitterfeed.js and a correct relative path to twitteroauth.php. I looked at you troubleshooting tips and I’m quite sure I’ve done everything as it should.
Thanks in advance!
Tom, I saw your comment about using the console in Chrome and I found that I was using an inccorrect absloute path. I should not have used the www
Now, I have an invalid character error, so I’m looking further into it 🙂
Hi Tom,
I still have the unexpected character (in Chrome it says parsererror – SyntaxError: Unexpected token <) and I cannot find the culprit. I have no extra HTML in my get tweets php, I just copied your version of it.
Can you help me? The site I'm working on is http://www.disis.nl
Thanks in advance!
I got a reply from the hosting company: PHP was not switched on. I guess that has to be the cause of my problem.
Sorry for cluttering your comments! 😉
i got you code to work. the php files gets all my tweets, but the container shows only one tweet. i have not changed anything
I can only see one tweet. why is that. i have the php file with all my tweets in jSOn format
Hi Tom, awesome app and just what I needed after Twitter pulled the plug on the older api.
Ive got it all working, but I am having one small issue, I can get the Tweet, retweet and favourite icons to appear… it kind jerks like its going to but then nothing? Any idea what I have done wrong, cause everything looks good to me.
You can see the issue here: http://tanisharose.com/Twitter
Many thanks in advance for any help
Hi Regil, yes – looks like your twitter feed is on the non-www but your calling the php in your twitter feed JS using the www. Try changing your getJSON path in the JS to http://yoursite.com/pathtotwitterfeed (without the www)
Hi Tom,
Thank you for the quick response.. i already fixed it i just added this code to my get-tweets.php
” header(‘Access-Control-Allow-Origin: *’); ” ..and it work.. but I’ve got another problem the tweet-actions buttons are not visible when hove.. thank you Tom for the awesome plugins/app.. 😀
Hi Tom,
First, thanks for te excellent tutorial!
I’m getting an alert error when I reload the page or change to another page before the tweets are loaded. I noticed that it happens with your demo too, is that ok?
Thanks again for the great tutorial!
Hi There,
I seem to be able to get everything to work apart from the profile picture… not sure where I am going wrong here 🙁
any clues?
Thanks in advance
Stephen
All sorted – being dim – the twitterfeed.js was looking for the images in ‘js’ removed this and it works 🙂
Thanks this is v.cool 🙂
Hello again. I just sent you a comment, never mind that.
I saw one of the comments above with the same issue:
“Hey there, it’s a cross-domain error as your trying to access the tweet file from non-www. If you change your $.getJSON request to your get tweets php …”
Solved it!
Thanks a lot.
Eduardo
Hello,
First of all a lot of thanks for the very helpful guide.
Second into my issue/question. Well i would like to ask how can i make the script to update dynamically the tweets, i mean as it was before on twitter stream api v1 when you had the stream and it was refreshing automatic and shown different tweets.
I hope you understand what i mean.
Thanks again and wait for answer.
Dimitris
Hi Tom,
Thanks for the help with this, replacing my failing twitter feed has been on my agenda for a while now.
However, I seem to be struggling with it a little.
I have the jSON working fine it would seem but when I open my display page I can only see my profile name and screen name. The link to twitter works but no tweets are being displyed, and i get the missing image icon where my profile pic should be.
I also get a pop up error message which just says “error – “.
Am I missing something obvious, jquery is still a bit of a mystery to me. Should I be using an .html file rather than .php.
link: http://www.181webdesign.com
Thanks
Anthony
YOUR MY HERO!
If you could do a animation tutorial that would be amazing. Like few others I’d love to display one tweet at a time and be able to rotate through my latest tweets.
+1 for the animation tutorial!
Really great set of tutorials so far. Thanks a bunch. Would be perfect if you could finish it with a animation tutorial.
Hi Tom,
The js library is conflicting with my lightbox libraries. I have updated it to version 1.9.1 and it is still conflicting. (The twitter feed won’t even work at all when I update to 1.10.) Here is what my script tags look like in the head section.
Know of any workarounds for this?
Thanks,
Laura
Never mind, I figured it out.
I replaced all instances of “$” with “jQuery” in jquery-1.9.1.min.js and twitterfeed.js. I did not even have to use noConflict mode.
Thanks anyway 🙂
Hello, great tutorial! Thanks for the time put into this. I have a question however; when I try to integrate it into my site template, it throws up an error dialogue box with no message. The page still loads, and so does the twitter box, but the feeds never loads. Any thoughts? Thanks in advance!
Hi Tom,
Thanks for this script, its the only twitter API1.1 plugin that I’ve managed to successfully get working. Quick rookie question, I’ve tried absolutely everything to centre the profile image above a tweet but cannot for the life of me sus out how to do it. Please please can you help? You can find the styling that I’ve managed so far at: http://www.mdwoodman.co.uk
Thanks in adavance,
Matt
Managed to get it working in the end, the inline-block was important but the essential style that finally solved the problem was ‘float:none !important;’ 🙂
Thanks for all the support Tom and once again thanks for an excellent blog/tutorial!!!
Hi Tom, I read all your articles and created a custom twitter feed for my web site succesfully. However I have two problems.
1. Date format is in English (e.g. 7 Jul), how can I change it to German or any other languages?
2. I’m using my own short urls but your script gets urls as t.co.
Hi Tom I’ve read all the posts and double checked my code but cant find the same problem.
The json outputs fine, but when I call it into the page to display it, a pop up comes up saying “error -”
Any ideas?
Hello,
Thank you for this… really is what I have been looking for..
Steve
hi Tom,
May I post this article in my website ? I would include this plugin with codeigniter.
I created a way to “automatically” cache the tweets when the server/scenario wont allow you to use corn jobs or any other task automatisation tool, check it out 😀 .
https://github.com/Q-ro/-Automatic–twitter-caching-for–cornjobless–servers
I also made some changes to the way you laid out the HTML for the feeds inside the javascript file.
Also added CSS enhancement as to comply with the “responsive design” trend.
well, hope to hear form you.
Hi Tom, great redesign of your site in short notice. Didn’t look like this a week ago or so, right?
I implemented your Custom Twitter Feed code. Ran okay on localhost (though not without laborious effort). When it went live, it throws the following error:
parsererror – SyntaxError: JSON.parse: Unable to parse value: <br (on Opera)
and
parsererror – SyntaxError: JSON.parse: Unable to parse value: unrecognized character (on FF)
I deleted the only [break tag] tag in the twitter-feed.js file, and there can’t be break tags in the tweets themselves. I’m fairly good with PHP so I’m sure PHP’s not to blame.
I’d appreciate your expert recommendation or advice.
The site is http://aadodf.org.ng/
***Good thing you have going on here, helping people out with these solutions.
I did a quick search for the word “parse” on this thread and found that someone had reported the same problem and you told him it had to do with cross-domains. I added “http://www” to the request for the get-tweets-php file and after upload and refresh, the page just pops an alert “error-“. I found this when I looked at the console as the page loaded:
FB.getLoginStatus() called before calling FB.init().
Security error: attempted to read protected variable
Security error: attempted to read protected variable
Security error: attempted to read protected variable
Security error: attempted to read protected variable
I also have a Facebook Social plugin box and button on the page, so…I wonder!
Can you please help me make sense outta this? Thanks a bazillion!
Thanks for the awesome script. It’s working great bar one issue with it which I can’t figure out. I’ve used your method on two sites so far and the same issue on both:
When I click away to another page before the previous page (more accurately the twitterfeed.js file) has fully loaded, I get an alert saying “error -” which I have to Ok before moving on. Any ideas on how to stop this alert from appearing if users click away from a page too quickly?
The twitter-feed.js file, though fully loaded, did not call the get-custom-tweets.php file. This caused the error.
Try edit the call to read:
$.getJSON(‘//[your-domain]/[path]/get-custom-tweet.php’,
Omission of the “http:” is not a typo.
I hope this works for you, ‘cos it worked for me.
Thank you Tom for taking the time to write this, works like a charm, clear, concise and easy to follow. If only Twitter had someone like you writing their docs eh!
Hi Tom!
For some reason my previous post disappeared on your blog. I have a problem with the php file uploaded to the server. The error says: ” not found: sweets php script ” It seems get-tweets1.php is not found on the server when it is clearly there in the folder. I have double checked the path too, but couldn’t find any problems.
Please help me
Thank you!
Hi Rajit, yes looks like the Modernize WordPress theme has a widget that uses the old API and it’s no longer a simple case of changing the Twitter path/endpoint. If the theme hasn’t got an updated widget then you might need to either find a WordPress API 1.1 Twitter plugin or manually edit the themes files. You first need to get your Twitter feed authenticated (see my twitter authentication tutorial) then create a styled feed as described in this post.
thanks you for this great piece of code
it has been working for me for a few days and now it has stopped
this is the error I get
{“errors”:[{“message”:”Timestamp out of bounds”,”code”:135}]}
do you have any idea what this means, and how can I fix it
thanks
Hello Tom, thanks for the excellent tutorial! I am new to php, javascript, and html. I’m trying to learn them by interacting with the twitter API and this tutorial is great. I have got the .php authentication working and outputting in json format as far as I can tell.
However, when I go to run the html page with the call to the js file I just get an [object Object] pop-up window. I tried adding the $ as suggested and it didn’t do anything. Any help would be appreciated, thanks!
I have the full www address in the getJSON line to my search_test.php file as well.
Dear Sir,
I am Looking One Twitter Widget, & Tweets Should Be Rotate
Will You help me This Twitter Widget,
for My Weebly Blog
Thanks
pankaj
Hi Tom,
First off, thanks for the wonderful guide and plugin. I have been able to configure the get_tweets.php fine and it is outputting json, however, for the life of me cannot get the tweets to display. I have tried every single suggestion in these comments. I am running a wordpress blog platform but this test page should not be affected by it. I previously had the cross domain error but seem to have resolved it, now it Chrome simply states “Uncaught ReferenceError: exception is not defined twitterfeed.js:115”
This must be a generic parse error.I would very much appreciate it if you could spare the time to help me out.
http://www.tcmzone.com/twitterjson.html
Hi Tom, apologies me again. Reading back through some of the posts I’ve removed www. from the $.getJSON and the tweets load…but again I get a weird object error. Let me know if you have any ideas what the problem may be 🙁 Thanks once again.