+1
Z odpowiedzią
Query json data
I intend to use datasource with json but i couldn't find how to query json data in the tutorials.
Customer support service by UserEcho
https://studio.rarewire.com/wordpress...
I'm using the intro to twitter integration example and am getting held up on the tweet action. Using alerts, I see the first if statement is used, but nothing else happens. I've pasted my wire dealing with twitter below. Any hints or suggestions? Thanks in advance.
I am not seeing your example code. Can you wrap it in a < code > block please.
Thank you.
<datasource name="twitter-feed" source="" query="//status" providertype="json"/>
<datasource name="twitter-post" source="" query="//status" providertype="twitter"/>
<panel name="tweet" style="btn" align="center" valign="center" onclickup="share-twitter">
<image name="twit" source="images/tweet.png" align="center" valign="center"></image>
</panel>
<panel name="twitter-status" alias="TWITTER-STATUS" width="94%" height="160" alpha="1" ypos="-65%" bordercolor="#ffffff" borderwidth="6" align="center" shadowradius="3" shadowxoffset="1" shadowyoffset="1" shadowopacity=".8">
<image name="tbackground" source="graphics/bg.png" width="100%" height="100%" align="center" valign="center"></image>
<textfield name="textfield" alias="TWEET-TEXTFIELD" width="88%" height="80" cornerradius="8" align="center" multiline="yes" bottomof="toolbar" ypos="12" onreturnkeypressed="null" background="ffffff" size="14"></textfield>
<panel name="ttoolbar" width="88%" height="40" ypos="100" align="center" background="#dddddd" cornerradius="10">
<image name="button-clear" source="images/cancel.png" valign="center" xpos="10" onclickup="close-share"></image>
<image name="twt" source="images/tweet.png" align="center" valign="center" ></image>
<image name="button-send" source="images/share.png" valign="center" align="right" rightmargin="10" onclickup="tweet"></image>
</panel>
</panel>
<panel name="tbrowser" alias="TBROWSER" width="100%" height="100%" ypos="1000%" alpha="0">
<panel name="toolbar" width="100%" height="10%" lheight="17%">
<panel name="background" width="100%" height="100%" background="#000000"></panel>
<panel name="hightlight-light" width="100%" height="1" valign="bottom" background="#ffffff" alpha=".2"></panel>
<panel name="twiterAuth" alias="TWITTERAUTH" width="80%" lwidth="57%" height="100%" alpha="0" align="right" rightmargin="2%">
<textfield name="id-textfield" alias="id-textfield" placeholder="authorization code here" font="HelveticaNeue" size="18" border="round" align="left" height="70%" lheight="75%" width="65%" lwidth="95%" ypos="15%" lypos="20%"/>
<image name="id-submit" source="button.bg.png" align="right" valign="center" onclickup="submit-twit-id" >
<text name="button-submit" width="100%" height="fit" color="#ffffff" valign="center" font="HelveticaNeue-Bold" size="12" alignment="center" text="Submit"></text>
</image>
</panel>
</panel>
<web name="tweb-viewer" alias="TWEB-VIEWER" width="100%" height="90%" lheight="83%" url="" pagetofit="yes" valign="bottom"></web>
</panel>
<action name="share-twitter">
<assign property="object:TWEET-TEXTFIELD.text" value="Check out this article: [var:guid] via @wholovescontent" />
<translate ypos="14%" time=".5" target="TWITTER-STATUS"/>
<keyboard visible="yes" target="TWEET-TEXTFIELD" />
<play action="popin"/>
</action>
<action name="tweet">
<assign property="var:currentmsg" value="[object:TWEET-TEXTFIELD.text]" />
<if lhs="[preferences:twitter-activated]" operator="ne" rhs="active" >
<assign property="datasource:twitter.source" value="http://api.twitter.com/1/statuses/update.json?status=[var:currentmsg]" />
</if>
<if lhs="[preferences:twitter-activated]" operator="=" rhs="active" >
<assign property="datasource:twitter.source" value="http://api.twitter.com/1/statuses/update.json?status=[var:currentmsg]" />
<alert message="i tweeted"/>
</if>
</action>
<action name="display-twitter-auth" datasource="twitter-post" datasourceevent="interactionrequest">
<alpha value="1" time=".25" target="TBROWSER" />
<translate ypos="0%" time=".5" target="TBROWSER" />
<assign property="object:TWEB-VIEWER.url" value="[datasource:twitter.dataSourceInteractionRequest]" />
<alpha value="1" target="TWITTERAUTH" />
</action>
<action name="submit-twit-id">
<keyboard visible="no" target="../id-textfield"/>
<assign property="datasource:twitter.dataSourceInteractionResponse" value="[object:id-textfield.text]" />
<alpha value="1" time=".25" target="TBROWSER" />
<translate ypos="100%" time=".5" target="TBROWSER" />
<load url="://blank" target="TWEB-VIEWER" />
<alpha value="0" target="TWITTERAUTH" />
<assign property="datasource:twitter.source" value="http://api.twitter.com/1/statuses/update.json?status=[var:currentmsg]" />
<assign property="preferences:twitter-activated" value="active" />
</action>
<action name="close-share">
<translate ypos="-100%" time=".25" target="TWITTER-STATUS" />
<keyboard visible="no" target="TWEET-TEXTFIELD" />
</action>
Also, I've added the consumerkey and secret.
Thanks a lot,
Nathan
Can you give me a little more information on the device you are using? Does it have ios 6? Are you logged into Twitter from the settings app on the device?
With Twitter changing their API settings to 1.1 and requiring authentication to see a feed and to post, our twitter integration is a little off depending on the scenario you are in.
I'm testing on an iPad 2, iPod 3, and iPhone 5. They all have ios6. The twitter feed works within the app.
Thanks again,
Nathan