Twitter API - Is it broken or am I using it wrong? - twitter

When I ask it to display 10 tweets, I get one. When I say 11, I get 3. But when I say 20, I get 20. Am I doing something wrong?
This is my code:
<div id="twitter" class="widget">
<div class="twitter-header"></div>
<div class="twitter-content">
<ul id="twitter_update_list">
<li>Twitter feed loading</li>
</ul>
</div>
<div class="twitter-footer"></div>
</div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/trekradio.json?callback=twitterCallback2&count=10"></script>

The problem is that you're not seeing retweets in the timeline. Sadly, with the method you're using, you can't use
include_rts=1
Change the line to
https://api.twitter.com/1/statuses/user_timeline.json
?screen_name=trekradio
&include_rts=1
&callback=twitterCallback2
That will retreive the JSON with all the retweets in the timeline.

Authentication is now required on user_timeline (see: https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline) and version 1 of the API has retired since June 11, 2013 (see: https://dev.twitter.com/blog/api-v1-is-retired).
So, if anyone gets stuck on #Terence answer, go look at the changes in the current API.

Related

Making an upload video button in rails but still do not run

I am trying to make a very simple rails program to upload video. And here is my code
<div class="row">
<div class="col s12 m6">
<div class="card blue-grey darken-1">
<div class="card-image">
<script src="//fast.wistia.com/embed/medias/<%= #course.video %>" async></script>
<script src="//fast.wistia.com/assets/external/E-v1.js" async></script>
</div>
My problem is, when I copy and paste the code from wistia.com to the box video, and try to upload it, the video still can not upload, I mean the video still does not change.
Could you please give me some ideas in this problem? I am a newbie and very confuse with this problem. Thank you very much.
If you are trying to load javascript from an external site you need to include the http protocol. However without implementation instructions from your vendor, this probably won't do anything. How does this javascript know where to insert video into your dom? Look at the documentation here in their example https://wistia.com/support/embed-and-share/video-on-your-website
So in your html, load the javascript first then assign the div like this:
<script src="http://fast.wistia.com/embed/medias/j38ihh83m5.jsonp" async></script>
<script src="http://fast.wistia.com/assets/external/E-v1.js" async></script>
<div class="wistia_embed wistia_async_j38ihh83m5" style="height:349px;width:620px"> </div>
So if we assume your data object has a string with the id of the video, something like this should work:
<script src="http://fast.wistia.com/embed/medias/<%= #course.video %>.jsonp" async></script>
<script src="http://fast.wistia.com/assets/external/E-v1.js" async></script>
<div class="wistia_embed wistia_async_<%= #course.video %>" style="height:349px;width:620px"> </div>

embedding twitter timeline with count in angular 7

I have embedded twitter time line in angular 7 using
Problems: I got too many twitters and I want only one or two etc
<script async src="https://platform.twitter.com/widgets.js"
charset="utf-8"></script>
<a class="twitter-timeline" data-dnt="true" data-link-
color="#E95F28"
[href]="twitter_link">
</a>
<script async src="https://platform.twitter.com/widgets.js"
charset="utf-8"></script>
<a class="twitter-timeline" data-dnt="true" data-link-
color="#E95F28"
href="https://twitter.com/ICICIBank?
ref_src=twsrc%5Etfw">
</a>
expected result should be: only one twitter time line not all blog
actual result is comming with all twitter time line
try this. just put data-tweet="3",. here 3 in count
<a class="twitter-timeline" data-dnt="true" data-link-color="#E95F28"
[href]="company?.companyIdentityNumber + '?ref_src=twsrc%5Etfw'"
data-tweet-limit="2">

Youtube Message: Channel Does Not Exist

Am using code provided by Google Developers to add Youtube button to website. When button is activated and the link to Youtube is made, I get a message on Youtube that "The channel does not exist."
See following code:
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channelid="UC73r_CJEG-2kH6VY1lW7gIQ" data-
layout="default" data-count="hidden"></div>
Have also tried i frame api:
<iframe data-gapiattached="true" frameborder="0" scrolling="no" height="25px"
width="174px" style="padding-right: 10px"
src="http://www.youtube.com/subscribe_embed?bsv&usegapi=1&channel=UC73r_CJEG-
2kH6VY1lW7gIQ">
</iframe></h6>
<div align="center">
<script src="https://apis.google.com/js/platform.js"></script>`
With i frame api, web page shows Youtube icon with an exclamation point and the word "Error".
Am using Dreamweaver CS5 and Safari.
If i understood the code, you want generate a suscriber button.
you can see this doc:
https://developers.google.com/youtube/youtube_subscribe_button?hl=nl
This code Work for me.
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channelid="UC73r_CJEG-2kH6VY1lW7gIQ" data-layout="default" data-count="default"></div>
http://jsfiddle.net/carlosrojas_o/9LLzjd7h/

SoundCloud Mobile Error

Alright guys,
I'm pretty new to all this so sorry if i don't make sense, I wish to use SoundCloud in my jquery mobile pages. I've got the following iframe code below to use:
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/100795671&color=ff6600&auto_play=false&show_artwork=false&sharing=false&download=false&show_playcount=false&liking=false&show_comments=false&auto_advance=false&show_user=false" id="player"></iframe>
</p>
<div class="ui-grid-a">
<div class="ui-block-a">
<button id="play">Play</button>
</div>
<div class="ui-block-b">
<button id="pause">Pause</button>
</div>
</div><!-- /grid-b -->
<script type="text/javascript">
var iframe = document.querySelector('#player');
var sc = SC.Widget(iframe);
sc.bind(SC.Widget.Events.READY, function () {
var d = document.createTextNode('Ready');
document.querySelector('body').appendChild(d);
});
document.querySelector('button').addEventListener('click', function () {
sc.play();
});
document.getElementById('pause').addEventListener('click', function () {
sc.pause();
});
</script>
im also calling these js files in the header
<script src="https://w.soundcloud.com/player/api.js"></script>
<script src="//connect.soundcloud.com/sdk.js"></script>
The problem i get is it won't play for me on my mobile view, the wavform image also seems to double up and cover the play/pause icon.
Screenshot:
http://imageshack.us/photo/my-images/109/qxix.png/
I've tested it on desktop view and there seems to be no issues viewing it that way, here is the page i'm testing it all on at the minute
http://www.blackburnravers.com/test/media/blackburnravers/blackburnravers_androidcore_v3.0.html
Is there out I've done wrong?
Hope somebody can help me out.
Thanks alot,
Blackburn Ravers
Unfortunately, due to implementation of the Widget API playing sound via external controls isn't possible in iOS – this is because of the asynchronous nature of postMessage and the limitation of iOS, that playback has to be initiated by user.

Form checkboxes not being displayed correctly second time shown

I have a weird problem with a simple form with checkboxes..
The first time it's shown it looks fine.. But then after navigating back to the previous page and be to it again - the ui is not updates resulting in plain checkboxes without jQuery mobile style..
I've Googled like crazy and found a couple of hints like .fieldcontain(); but it's doesn't work =(
The data is being retrieved through knockout bindings..
Any good ideas?
Here's the code...
<div id="searchCitiesPage" data-role="page" data-theme="a" class="page searchCities">
<header data-role="header" data-theme="b">
</header>
<div data-role="content" class="content" data-theme="a">
<script id="countyListTemplate" type="x-jquery-tmpl">
<form id="fieldform" action="form.php" method="post">
<fieldset id="fieldsetgroup" data-role="controlgroup">
{{each BoligPortal.AdSearch.postalcodesInSelectedCounty}}
<input type="checkbox" name="checkbox-${zipcode}-${timestamp}" id="checkbox-${zipcode}-${timestamp}" class="zipcodecheckbox"/>
<label for="checkbox-${zipcode}-${timestamp}">${zipcode} ${city}</label>
{{/each}}
</fieldset>
</form>
</script>
<div data-bind="template: 'countyListTemplate'"></div>
<div class="submit">
Næste
</div>
</div>
I was having a problem like this too, but in my case, the checkboxes were being redrawn dynamically before loading the page. I tried refreshing:
$("input[type='checkbox']").checkboxradio("refresh");
But it gave me an error stating that checkboxradio hadn't been initialized. However, when I tried this instead:
$("input[type='checkbox']").checkboxradio();
It made the checkboxes appear correctly every time. I'm still fumbling in the dark with JQuery Mobile and can't say exactly what happens where and why (I think I'm initializing the checkboxes?), but I thought I would share for the next time someone like me googles their way to this thread.
You can add some javascript to re-initialize the jQuery Mobile markup for your checkbox on each page load. Something like this:
<script type="text/javascript">
$(function() {
$('[data-role=page]').live('pageshow',function(){
$('#fieldform').find('input').checkboxradio();
});
});
</script>
I would suspect this code
{{each BoligPortal.AdSearch.postalcodesInSelectedCounty}}
<input type="checkbox" name="checkbox-${zipcode}-${timestamp}" id="checkbox-${zipcode}-${timestamp}" class="zipcodecheckbox"/>
<label for="checkbox-${zipcode}-${timestamp}">${zipcode} ${city}</label>
{{/each}}
is being called again when you transition back to the page. I would suggest pulling the infomation/tags/etc.. before the page displays (on the first load) and display it statically. So when transitioning back it shows the same data.
of you could use one of the live events and restyle it before the page shows, example:
$('.zipcodecheckbox').live('pagebeforeshow',function(event, ui){
$("input[type='checkbox']").checkboxradio("refresh");
// or
$(".zipcodecheckbox").checkboxradio("refresh");
});

Resources