XMLElement nodes
This is an open discussion with 5 replies, filed under General.
Search
Can I see a little more context? You have variables defined out of the scope of your foreach, can I see them too?
Hi, sorry it's just the data.base.php from this Twitter extension
https://github.com/passbe/twitter/blob/master/lib/data.base.php
It's around line 184 where I was just trying to add a little recursion to get at the entities part of tweets that I think got added to Twitter since this extension was made. I think you'd perhaps use RecursiveArrayIterator instead but that'd be different to how this original code has done it.
I'm getting confused I think with XMLElement and didn't get how to put nodes inside other nodes in the output XML. Or rather several nodes into a parent one, as I did manage to create several same nodes with a different child in each.
Probably I'm thinking about it the wrong way round. I'm on the live server too because of the OAUTH callback URL so can't see what's going on in the background, just the output XML in ?debug.
Cheers designermonkey
There is an example of the JSON structure here
https://dev.twitter.com/docs/entities#tweets
I've just been drilling straight down to the media_url_https
as that's what I needed but there's other nice stuff in there for people with other kinds of tweet.
Working now, I split the stuff up into separate arrays and it worked so I must have had things in the wrong order earlier.
Dude, sorry I didn't get back to you. Had a hectic weekend.
Glad you got it sorted out though.
Create an account or sign in to comment.
Messing with the twitter extension to grab first media image that's in a tweet. It's working but how do I make the XML slightly neater?
Puts the nodes of the media entities on the same level as the tweet nodes, how could I tell XMLElement that I want to have them as a child node of say "media", for example
My first guess resulted in a separate
per item because I'm inside the foreach.
Give us a clue?