0 users online. Create an account or sign in to join them.Users

Search

In the Twitter extension that I started to modify I wanted to mine down into nested retweets and such. It's working but you don't really know if there's going to be nesting or not, it depends on how the tweeter retweeted the tweet, and whether that tweet was a retweet.

So you can get these nested nodes or perhaps several nestings or maybe none at all.

I was thinking about how to save the tweets into a section, a section would have a pre-made bunch of fields but the incoming data may have an unknown number of recursive nodes.

Is this going to be something where you pick a floor for the number of nested levels you'll deal with? Am I thinking about this the right way?

The data is there in the XML output, so I just need to have a compatible section and save the data right? It's already been sanitized BTW.

Any pointers or things I need to look out for? First time with an extension that doesn't already save stuff.

Cheers as always

Have you seen that @briandrum has recently just released a Twitter extension? This may do what you need out of the box rather than having to edit an older extension.

Nesting, that could get tricky if you wanted to store nested tweets in a single entry(?)

@ijy I did see the extension, I've actually been modding the prior version at the same time. I don't think the extension handled nesting and I'm not sure it does now, I could be wrong but I'd thought it was a compatibility fix for 2.5.x

I was hoping to do it myself to learn how, I was hoping for a single entry and guess just limit myself to two or three recursions.

I think Brian's extension (and others) would just be aimed at saving a single tweet to a single entry. If you wanted to save multiple retweets to the same entry then yes, I'd imagine you'd probably have to limit it to a pre-defined depth so that you can provision the fields for storage.

I wouldn't say that would be the cleanest approach though. I'd rather have every tweet stored individually and relate them. I'm not sure what Twitter output in the feed API but there may be something there you can use to relate the tweets when saved individually.

That's a good idea, separating the tweets, I think that would be possible by noting the entry ID of the one you're already creating and relating to that.

I think I'll try saving just the top-level first to learn that process and then think about the recursion after that's working.

Just to be perfectly clear, it is Brian's extension but I took a slightly earlier version and began to work on that as I didn't know it was active at the time. I firstly made it work with 2.5 then carried on looking at recursion. Brian released his update since then but I thought I'd carry on, I started enjoying it after the inital success of getting it working.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details