Haggis Veteran Posted August 20, 2012 Veteran Share Posted August 20, 2012 <?php$json = file_get_contents("http://twitter.com/status/user_timeline/USERNAME.json?count=10", true);$decode = json_decode($json, true);$count = count($decode); //counting the number of statusecho "<img src=\"".$decode[0][user][profile_image_url]."\"</img><br>"; //getting the profile imageecho "Name: ".$decode[0][user][name]."<br>"; //getting the usernameecho "Web: ".$decode[0][user][url]."<br>"; //getting the web site addressecho "Location: ".$decode[0][user][location]."<br>"; //user locationecho "Updates: ".$decode[0][user][statuses_count]."<br>"; //number of updatesecho "Follower: ".$decode[0][user][followers_count]."<br>"; //number of followersecho "Following: ".$decode[0][user][friends_count]."<br>"; // followingecho "Description: ".$decode[0][user][description]."<br>"; //user descriptionecho "TimeZone: ".$decode[0][user][time_zone]."<br>"; //Timezoneecho "<br><br>";for($i=0;$i<$count;$i++){echo "Status: ".$decode[$i][text]."<br>"; //getting last 10 statuses}}?>[/CODE] This snippet will grab the particular users info from twitter along with the last 10 status just change USERNAME to your twitter username any questions let me know :) Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 Can you do one that embeds a tweet in a forum post to achieve what is requested here? http://www.neowin.ne...5-embed-tweets/ I can add php to bbcode replacement but not Javacript, although I can add the widget.js to our board header. https://dev.twitter....embedded-tweets Edit: Redmak is also working on this :p Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 I will certainly have a look and see what i can do I am at work just now and twitter is blocked can you get me a tweet id to work on? Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 here's one :) Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 if you add the widget.js to your board header this is the html replace for the bbcode <blockquote class="twitter-tweet"><p>Javascript is not enabled</p><a href="https://twitter.com/twitterapi/status/237131910013394944">Click here to view the Tweet</a></blockquote>[/CODE] so would just be the tweet id needing replaced I will look more when i get home, let me know if this is useful though :) Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 so [tweet]237131910013394944[/tweet][/CODE] [CODE]<blockquote class="twitter-tweet"><p>Javascript is not enabled</p><ahref="https://twitter.com/twitterapi/status/{content}">Click here to view the Tweet</a></blockquote>[/CODE] if this is not what you mean i can make a bit of code to pull the particular tweet then you could just add some niceness to the display lol Steven P. 1 Share Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 damn, I knew it was as easy as this! I'll give it a try, thanks.. I was getting a bit confused with the "content" switch lol Hmm does that post a link, or the embedded tweet? Javascript is not enabled or refresh the page to view. Click here to view the Tweet It friggin works! Javascript is not enabled or refresh the page to view. Click here to view the Tweet Different tweet test Shaun N. 1 Share Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 Cool glad it works :) Steven P. 1 Share Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 Javascript is not enabled or refresh the page to view. Click here to view the Tweet Cool glad it works :) Thanks, I've modified it so the whole URL can be pasted in (easier to remember for everyone) Example: [tweet]https://twitter.com/NeowinSteve/statuses/237116811357859841[/tweet] Replacement: <blockquote class="twitter-tweet"><p>Javascript is not enabled</p><a href="{content}">Click here to view the Tweet</a></blockquote> Thanks for your help on this :) Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 No probs at all :) as i say glad i could help Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 No probs at all :) as i say glad i could help It doesn't load with fast reply, but youtube videos do, do you reckon there's a way around this? Could it be the Javascript notice that stops it loading? Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 Going by this link its the JavaScript I will look though http://community.invisionpower.com/resources/bugs.html/_/ip-board/fast-reply-post-wont-parse-the-javascript-in-a-custom-bbcode-r37994 Steven P. 1 Share Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 Javascript is not enabled or refresh the page to view. Click here to view the Tweet Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 Hmm I suppose it calls the javascrtipt in our header to render the tweet? <script src="//platform.twitter.com/widgets.js" charset="utf-8"></script> which is only parsed with a page refresh. I don't see a way around this lol Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 yeah looking at the ipb site the javascript wont parse in a fast reply so the bbcode wont work its should work once the page is refreshed so will only not work for you once the post is submitted Javascript is not enabled or refresh the page to view. Click here to view the Tweet Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 Yeah, I can live with that :) Thanks again for your help (Y) Link to comment Share on other sites More sharing options...
0 Haggis Veteran Posted August 20, 2012 Author Veteran Share Posted August 20, 2012 No Probs :) Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 20, 2012 Administrators Share Posted August 20, 2012 Updated the helper text to reflect this "Javascript is not enabled or refresh the page to view." Link to comment Share on other sites More sharing options...
0 Seahorsepip Veteran Posted August 20, 2012 Veteran Share Posted August 20, 2012 modify the post button to get it working with fast reply without a page reload: <input type="submit" id="submit_post" class="input_submit" name="submit" value="post" acceskey="s" tabindex="0" onclick="tweet();">Post</input>[/CODE] [CODE]<script>function tweet { if #submit_post content contains the following text "[tweet]" { *idk code to lookup text in a element :p* *tweet code*}</script>[/CODE] Link to comment Share on other sites More sharing options...
0 Steven P. Administrators Posted August 28, 2012 Administrators Share Posted August 28, 2012 Javascript is not enabled or refresh the page to view. Click here to view the Tweet modify the post button to get it working with fast reply without a page reload: <input type="submit" id="submit_post" class="input_submit" name="submit" value="post" acceskey="s" tabindex="0" onclick="tweet();">Post</input>[/CODE][CODE]<script>function tweet { if #submit_post content contains the following text "[tweet]" { *idk code to lookup text in a element :p* *tweet code*}</script>[/CODE]That didn't work, oh well :p Link to comment Share on other sites More sharing options...
Question
Haggis Veteran
This snippet will grab the particular users info from twitter along with the last 10 status
just change USERNAME to your twitter username
any questions let me know :)
Link to comment
Share on other sites
19 answers to this question
Recommended Posts