LiveTwitter - CMC Tut

  • 2
  • Idea
  • Updated 8 years ago
Hello All,

I found an api script that when given a search term returns tweets with that term, and continues to find them with ajax loading. I thought it a pretty cool script so decided to try and implement it with Yola. Here is a example of it working with the term 'Yola', you can also download it there. The download includes a ReadMe file, or optionally here is the instructions:

1. First download the .zip and extract the contents.

2. Upload the contents to your resources folder, at the root.

3. Add a html widget and place this code inside it<!--:

<script src="http://ajax.googleapis.com/ajax/libs/..." type="text/javascript"></script>
<script type="text/javascript" src="resources/jquery.livetwitter.js"></script>
<link rel="stylesheet" href="resources/livetwitter.css" type="text/css" media="screen" />

<div id="twitter_content">
<img src="http://dev.connormccarra.com/wp-conte..." alt="Loading..." id="ajaxloader"/>

<div id="twitterSearch" class="tweets"></div>
<script type="text/javascript"> $('#twitterSearch').liveTwitter('Yola', {limit: 10, rate: 5000}); </script>
</div>

4. Change the search term (<script type="text/javascript"> $('#twitterSearch').liveTwitter('Yola', {limit: 10, rate: 5000}); </script>) to your liking. -->

There it is your own Twitter api working in Yola. You may need to tweak the css file to suit your site layout, also you need Yola Pro for this. You can use this thread for support if you have any problems, I'm happy to help.

Connor McCarra
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
  • happy

Posted 8 years ago

  • 2
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Nice 1 Connor - looks good.
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
Thanks Lee
Photo of Ruth

Ruth

  • 2819 Posts
  • 135 Reply Likes
Thanks, Connor.
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
Thanks Ruth
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
Also forgot to say that it can be used to pull tweets from a certain user by given it the usersname, here's the code:


$("#twitterSearch").liveTwitter('connormccarra', {limit: 10, rate: 300000, mode: 'user_timeline', showAuthor: true});


"connormccarra" would be replaced by the username of your choice. This code would replace this part of the script:


$('#twitterSearch').liveTwitter('Yola', {limit: 10, rate: 5000});


Connor
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
Really useful, thanks for sharing it!
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
I've started to add this to my site - its really good - any idea how to get it to search for your favorites instead of just searching your user name - you can do it with Twitters built in reader.

If you can show favorites it helps moderate what gets seen.

Lee.

http://hexham.info
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
Hey Lee,
Sorry for the late reply. I took a look and tried out a few changes but I don't believe you can, well at least I don't think you can.

Connor
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Thanks anyway - You can change it to read a user timeline instead of a search of the user name. You can then add a static image for that user.

If you ever discover a favorite reader let me know.

Lee.