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 6579413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:53:42+00:00 2026-05-25T15:53:42+00:00

I would really love some help on this one. What I have is a

  • 0

I would really love some help on this one.

What I have is a twitter JSON request and everything works great but I would like to style the mentions and hashtags appropriately as at the moment the whole tweet just looks the same and I think making this change would vastly improve it.

At present I tried to change the hashtags but it seems to be causing an error, I think it’s because I’m using $(this).html(linkHashtags($(this).html())); when it’s not html I’m reading.

The next stage would just be to do the same for @ (mentions).

Here is the code at present:

var url='http://search.twitter.com/search.json?q=';
var query='%23HASHTAG';
var options='&result_type=recent&rpp=4&page=1&callback=?';
var html='<marquee behavior="scroll" scrollamount="1" direction="left">';

$.getJSON(url+query+options,function(json){     
        $.each(json.results,function(i,tweet){

             $(this).html(linkHashtags($(this).html()));

             html+='<span class="tweet"><img class="profile-pic" src="'+tweet.profile_image_url+'" width="40" height="40" /><span class="tweeter">'+tweet.from_user+'</span>:&nbsp;'+tweet.text+ ' <i>' + daysAgo(tweet.created_at) + '</i></span>';
        });

        html += '</marquee>';
       // Now replace the <p> with our <marquee>-element
       $('.twitter p').replaceWith(html);
       $('div.twitter marquee').marquee();
});

var linkHashtags = function (text) {
return text.replace(
    hashtag_regexp,
    '<a class="hashtag" href="http://twitter.com/#search?q=$1">#$1</a>'
    );
} 
  • 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-05-25T15:53:43+00:00Added an answer on May 25, 2026 at 3:53 pm

    Use twitter-text-js:

    twttr.txt.autoLink("link @user, please #request");
    

    Example: http://jsfiddle.net/44DZ9/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would really love some debugging help in this one. I've been working on
I would really love some help with this. Currently when I use the following
I would love some help on a particular design. This is the code I
any help with this would be great. I have a model public class Master
I would really appreciate it if some of you could help optimize my tables,
I would really appreciate if you could shed light on this problem. I have
Some newbie questions. First, I would love to get this plugin: http://archive.plugins.jquery.com/project/getAttributes but I
I would really love to push for TDD development inside the shop I'm working
So I'm getting really sick of E*TRADE and, being a developer, would love to
I would really like to see a proportional font IDE, even if I have

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.