Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is a javascript program that uses twitter API to \"scrape\" tweets off of a

ID: 3585883 • Letter: T

Question

This is a javascript program that uses twitter API to "scrape" tweets off of a user's profile and output the text. I only want this script to output the lines that do not start with "RT @." In other words, I only want the program to output the tweets tweeted by the profile and not to output the retweets on the profile. Please see the code and the output below.

Here is the output of the code above:

I only want the output to output the lines that do not contain "RT @"!!! Please help!!

var handle = 'myiostsoul'; T.get('statuses/user_timeline', ( screen_name: handle, count: 20, exclude_replies: true, function (err, data, response) if (data) for (var 1.0 ; 1data.length; 1++) console.log (data[i].text); L1)

Explanation / Answer

var handle='myiostsoul';
T.get('statuses/user_timeline',{screen_name:handle,count:20,exclude_replies:true},

function(err,data,response)
{
if(data)
{
for var i=9;i<data.length;i++)
{
console.log(data[i].text);
}
}
})

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote