CCC&D

Center for Craft, Creativity & Design

twitter data parsing

Posted by Taylor Bernard on October 1, 2015

what about this.

getting it to this level help you out. no idea how to break those data parts apart and put them in different divs though

http://codepen.io/anon/pen/WQpbLe

Comments

Taylor Bernard on October 2, 2015:

you take a look at that? is this sufficient to move on to something else.

Justin Bernard on October 2, 2015:

bam. got it working.  been on it for a few hrs.

http://codepen.io/anon/pen/ZbeKZr

works fine.  you can see i just modded the JS plugin a bit (i unminified/beautified it)

i then hard coded in 5 paths, assigning specific tweet content to each

you should be able to look at the JS and see where i called out tweet0, tweet1, etc.  should be able to just point it to divs in the working site and be all good

only possible mod will be to make it match the tweet count we need. its fixed, but i just guessed at it being 5.  let me know if need help, but you should be able to patch it together now.

Taylor Bernard on October 2, 2015:

cool  cool.

hows the html breaking though?

it looks like theres a

<p class="tweet"> AUTO FILL WITH RETURN VALUE</p>

and for some reason its printing the html as well? hows that getting injected and how to remove it.

Justin Bernard on October 2, 2015:

pclass junk removed
http://codepen.io/anon/pen/ZbeKZr

whats breaking?

put this js in a seperate js file, and ill organize later on

Taylor Bernard on October 2, 2015:

oh i meant breaking as in the pclass thing showing up. should be good now thx

Taylor Bernard on October 2, 2015:

i dont get these in his code:

var g = [],
                    f = [],
                    h = [],
                    b = [],
                    m = [],
                    t = [],
                    e = 0;

are those just predefined variables in another library or something, so he's able to make shorthand out of them?

Justin Bernard on October 5, 2015:

did you not finish this on friday?
in basecamp you had note about some css bug, what was that?

what have  you been working on today already?

Taylor Bernard on October 5, 2015:

yeh i had a bug but i figured it out.

now i'm trying to put in a jquery code snippet to limit character count of a div and append a '...' to the end of the string. so it doesnt overflow big tweets out of the widget

Justin Bernard on October 5, 2015:

you had note on scrum about some bug posted on basecamp, but i couldnt find it.  what was it/did i just miss it being posted?

is it 100% except for the trimming of characters now?

that will need to be done with something like this

http://stackoverflow.com/questions/5275021/how-to-cut-off-text-inside-a-div-when-it-reaches-a-certain-of-characters-in-jq

it will have to be done within the function that assigns the text to the div, so that it waits for that text to be loaded first, then trimmed

Taylor Bernard on October 5, 2015:

theres still a css gallery bug on the WP version. if thats what youre talking about still existing.
i fixed the twitter bug this morning.

Justin Bernard on October 5, 2015:

the gallery bug thumbnail thing?  if thats what you mean, ill get to that later, all good

twiter bug you fixed this morning the one to limit it to a char count?  or something else?

Taylor Bernard on October 5, 2015:

so i need to put the jquery in the same JS as the twitter feed so it truncates the string before it sends it out to the div?

Justin Bernard on October 5, 2015:

yep, exactly

have you found good trimming code snippet yet?

Taylor Bernard on October 5, 2015:

i found this one. but yours already has an append '...' added into it.
 looks to do the same thing right.

http://stackoverflow.com/questions/19425555/maximum-amount-of-characters-in-a-div-paragraph-tag

Taylor Bernard on October 5, 2015:

not seeing where to inject that jquery code in the twitterfetch.js file.

also found this one but couldnt get it to work, he's using the 'txt' method and a lot of the other ones say you have to use the 'html' method for the string.


http://jsfiddle.net/markcoleman/bjKAQ/

Justin Bernard on October 6, 2015:

this has been fixed in JS at /seco.  it now has a var that can be set that sets max char, and if trims it down, adds a '...'

http://client.fleeangrybear.com/cccd/seco/social.html

var currently set to maxLength = 100, need to later trim to fit the avail text space

Taylor Bernard on October 7, 2015:

updated social widgets + @2x icons

Justin Bernard on October 8, 2015:

see if you can get this wired to their actual accounts next plz

Taylor Bernard on October 8, 2015:

when can you get IG and twitter creds

Justin Bernard on October 8, 2015:

Be a while

Taylor Bernard on October 8, 2015:

what else to mess with

Justin Bernard on October 8, 2015:

Content transfer from old site