solved Limiting responses from a twitter script

perrie
@perrie
7 years ago
435 posts
I have embedded some code from Twitter for a twitter feed, but the feed is way too long.
Is there a way to either have the feed scroll or to limit the feed to X number of responses?
updated by @perrie: 04/14/17 10:50:59PM
brian
@brian
7 years ago
10,148 posts
Wherever you got the embed code from you will want to check and see if you can pass in a URL argument to limit the results. That's something that needs to be done on the remote end.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
perrie
@perrie
7 years ago
435 posts
Brian,
Twitter gives you two choices of code and I am confused as to how to figure it out.

First they give 2 html codes:


Tweets from https://twitter.com/{screen_name}/lists/{slug}



Tweets from https://twitter.com/twitter/lists/official-twitter-accts


or a javascript one which is attached.

Which would I use and how would I fill it out if the script is :
Tweets by realDonaldTrump
perrie
@perrie
7 years ago
435 posts
This is the attachment I forgot
michael
@michael
7 years ago
7,714 posts
The code you're using is not jamroom.

You need to provide URL's to the documentation of the code you are using if you want help.
Also the code you are using in order to make it possible for anyone to help.

This question would be better suited to the site where you got the code from.
perrie
@perrie
7 years ago
435 posts
Sorry to have troubled you, Michael.
michael
@michael
7 years ago
7,714 posts
I'm willing to go read the docs and help you figure it out, but you're not providing enough information to let me do that.

currently the question reads: "I have a script from somewhere, how do i use it".
perrie
@perrie
7 years ago
435 posts
Thank you Michael.
It's twitter. Here is the page with the instructions for how to achieve what I am looking for:
https://dev.twitter.com/web/embedded-timelines/list

and this is the code I was given for this specific feed:
Tweets by realDonaldTrump

Any help would be appreciated. Their forum is not particularly helpful.
brian
@brian
7 years ago
10,148 posts
See the "Display a specific number of Tweets" section here:

https://dev.twitter.com/web/embedded-timelines


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
michael
@michael
7 years ago
7,714 posts
in order to add code here in the forums, you need to wrap it in [ c o d e] [/ c o d e] without the spaces. Otherwise the code will be stripped out. particularly if it has SCRIPT tags in it.

The code you posted got stripped, could you post it inside code blocks please.
perrie
@perrie
7 years ago
435 posts
I got it to work Michael. Thanks.
michael
@michael
7 years ago
7,714 posts
Well done. Its possible that someone will come along later and read this thread and have the same issue you had. If you could outline how it is done for the next person I'm sure that will be appreciated.

Thanks.
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
michael:
in order to add code here in the forums, you need to wrap it in [ c o d e] [/ c o d e] without the spaces. Otherwise the code will be stripped out. particularly if it has SCRIPT tags in it.
The code you posted got stripped, could you post it inside code blocks please.

Perrie, these instructions will enable you to post code samples here in the help forum in the future. I hope you take note of how to do it- I use it all the time myself when asking for help here. :)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
perrie
@perrie
7 years ago
435 posts
Hi Michael and Strumelia,

Sorry about not getting back quicker, but I am running a meta article and they take up a ton of my time.

Here is the code I used, done as advised:
<script async="" src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</b></span></p>
<p class="p1"><span class="s1"><b></b></span></p>
<p><a class="twitter-timeline" href="https://twitter.com/realDonaldTrump" data-tweet-limit="5"> Tweets by realDonaldTrump </a>

Please note the ( tweet-limit="5"). You can change the 5 to any number you like.

I hope that helps!
updated by @perrie: 01/11/17 09:15:25AM
Strumelia
Strumelia
@strumelia
7 years ago
3,603 posts
No Perrie- note that Michael's instructions state "without the spaces". He had to put spaces so it wouldn't trigger the action when he was just trying to describe to you.
Here, I'm attaching a PICTURE of what you should type in with the brackets on each end of the code you want to post here in a forum post... note there are no spaces in the word "code" or within each bracket and / etc.

edit: Ah- I see you 'got it' now! :D
code-pic.jpg
code-pic.jpg  •  128KB




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 01/11/17 09:23:14AM
perrie
@perrie
7 years ago
435 posts
Hi Strumelia

What happened was I copied and pasted the bracket code and it didn't take that way. So I went back and edited it with actually typing it out. There is another lesson learned! :)
michael
@michael
7 years ago
7,714 posts
Thanks Perrie, :)