Best recommendation for displaying Twitter feed?

Howdy,

What is the best recommendation for displaying a feed from Twitter? I have found Bastian’s tweets.php, although the script is not functioning for me. I am not certain if it is compatible with Kirby 2 or the most current Twitter API.

I am aware of Twitter’s own embedded Tweets documentation, although I would prefer a server-side solution that I can style on my own.

Any tips?

Thank you for your thoughts.
Timothy

I use tweetie.js for one project to display an account’s feed - but it also works for displaying tweets from a Twitter list or for a hashtag.

1 Like

Thank you, Nico! I will take a look.

@distantnative and @timothyingram , can you share your respective setups with tweetie.js? I’m having trouble implementing this approach, and would like a quick tip or two (maybe a 1-2-3 overview) on how you set up your feed using this method.

I tried @bastianallgeier’s tweets.php and that isn’t functioning for me, either. The only way I got my Twitter feed to work is via Twitter’s widgets.js, which is pretty vanilla and isn’t what I’m looking for.

Thanks for any help you can provide!

It’s from a project I did quite a while ago, so I hope this actually fits and still works.

In my template part:

<div class="tweet"></div>

<script>
  $(function() {
      $('.tweet').twittie({
          'username':'<?php echo $site->twitter(); ?>',
          'count': 10,
          'hideReplies': true,
          'template': '<div class="box-info">{{tweet}}</div>',
      });
  });
</script>

And I put the api folder into the assets folder.

Thanks for your help, @distantnative! I tried your approach and it doesn’t seem to work- the Twitter feed should display, but that element isn’t displaying at all and turning on debug doesn’t yield any helpful information. I’m able to implement it on a non-Kirby site, so looks like the problem is not with tweetie.js, but rather on the Kirby side. Were you able to verify that it still works for that project you did a while ago?

The API folder, along with the proper auth, is in the assets folder- no problem there. Any thoughts?

Hi @aftereffectsmagic have you set
c::set('twitter.key', yourTwitterKey); c::set('twitter.secret', yourTwitterSecret); in the config.php file? You can get these values when you register a new twitter app

I have successfully tested it yesterday.