Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:45:06+00:00 2026-06-03T01:45:06+00:00

I am pulling tweets using a twitter API and assigning it into a variable.

  • 0

I am pulling tweets using a twitter API and assigning it into a variable. LIke so.

        self.tweets = $.map(data.results, function(tweet){
                return{
                    author: tweet.from_user,
                    url: 'http://twitter.com/' + tweet.from_user + '/status/' + tweet.id_str,
                    image: tweet.profile_image_url,
                    tweet: tweet.text
                };
            });

I works for me. and I am appending the tweet to HTML. the text is like so..

 @drwarwick Hi David! Looking forward to catching up with you, but may not get in there today due to work commitments...

What I want to do now is wrap the @drwarwick into a @drwarwick so that I can style and link it accordingly. How do I find uisng jquery any such words in the tweets. Thanks.

EDIT>>>>>

something like stackoverflow is doing above. It has changed the color of the text.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:45:09+00:00Added an answer on June 3, 2026 at 1:45 am

    I just wrote a helper method to do that.

    function HighLight(input)
    {
        var output="";
        var items=input.split(" ");
        $.each(items,function(index,item){
           var word=items[index];
           if(word.match("^@"))
           {
               word="<span class='highlightSpan'>"+word+"</span>";  
           }                         
           output+=word+" ";
        });    
        return output;
    }
    

    Working example : http://jsfiddle.net/ZSafX/27/

    You can change your code to include that like this

        self.tweets = $.map(data.results, function(tweet){
                return{
                    author: tweet.from_user,
                    url: 'http://twitter.com/' + tweet.from_user + '/status/' + tweet.id_str,
                    image: tweet.profile_image_url,
                    tweet: HighLight(tweet.text)
                };
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java project where I am pulling tweets from twitter using the
I am pulling back some data from the twitter query API, and parsing it
I'm having some little issues pulling data from Twitter. Basically I am building a
I'm pulling data from an XML feed and manipulating it using the awesome SimpleXMLElement.
I am trying to format retweets like twitter does it - Having the tweet
I am pulling my data from a database and I am using json. What
I am pulling data from a sql server and putting it into a grid
I am pulling tweets from my twitter profile to my website. I'm adding REPLY,
I've been pulling the latest tweet via search.atom in Twitter. $feed = http://search.twitter.com/search.atom?q=from%3A .
Twitter's Streaming API seems to provide a way to receive realtime tweets without constantly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.