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

  • Home
  • SEARCH
  • 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 9008753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:01:05+00:00 2026-06-16T02:01:05+00:00

I have created an interface that allows people to Tweet at certain individuals from

  • 0

I have created an interface that allows people to Tweet at certain individuals from a webpage. To do so, I am utilizing Twitter’s web intents. At first, the page had a textarea that contained a placeholder tweet that was passed through as a text parameter when a user clicked a Reply button, but the scope has changed so that the user should be able to enter text in the textarea, click the button, and see the Twitter popup with their updated tweet, because user testing showed that people were less likely to tweet at people if they weren’t able to edit the content on the page.

The problem is that while this code does update the Twitter intent link, it seems to have broken some functionality of the Twitter intent link. Most notably, the links do not open up in a small popup like they normally do – instead, they replace the current page. Also, the “in_reply_to” functionality is intermittent – certain links that should contain tweets to reply to do not, while others do.

Anyone tried to do anything like this? And if so, any advice? I’m at a loss at this point.

The HTML (we’re using Django, hence the template logic):

<div class="response">
  {%if quote.tweet_id%} 
  <textarea id="twitter_response_text" class="has_tweet_id" maxlength="140">{{quote.twitter_handle}} {{quote.twitter_text_default}}</textarea>          
  <label for="twitter_response_text"><span></span></label>                     
  <a class="hasReply" data-tweet-id="{{quote.tweet_id}}" href="https://twitter.com/intent/tweet?in_reply_to="><button value="respond" data-quote-id="{{quote.id}}"/><img src="{{STATIC_URL}}img/reply_arrow.png"> Reply</button></a>
  {%else%}
  <textarea id="twitter_response_text" maxlength="140">{{quote.twitter_text_default}}</textarea>
  <label for="twitter_response_text"><span></span></label>
  <a href="https://twitter.com/intent/tweet?text="><button value="reply" data-quote-id="{{quote.id}}" /><img src="{{STATIC_URL}}img/reply_arrow.png"> Reply</button></a>
  {%endif%}
</div>

Javascript:

$(".response a, .twitteraction a").on("click", function() {

//get text from the textarea of the current slide

var textarea = $(this).parents(".slide").find("#twitter_response_text")
if (textarea.val() !== "") {
  text = textarea.val();
} else {
  text = textarea.text();
}

//maybe we need the handle?
// var handle = $(this).parents(".slide").find("#twitterhandle").text();

//get the link
var link = $(this).attr("href");


//check to see if it needs reply link or regular
if ($(this).hasClass("hasReply")) {

//get the tweet id, stored as data attribute in the anchor
var tweetId = $(this).data("tweet-id");

//construct the query with a twitter id but no handle
var query = encodeURIComponent(tweetId) + "&text=" + encodeURIComponent(text) + "&related=ForecastFacts&original_referer=http://climatecliff.org/";

//add link to anchor
$(this).attr("href", (link + query));

} else {  

//construct the query with text and related
var query = encodeURIComponent(text) + "&related=ForecastFacts&original_referer=http://climatecliff.org/";

//add query to anchor

$(this).attr("href", (link + query));


}
});
  • 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-16T02:01:06+00:00Added an answer on June 16, 2026 at 2:01 am

    Turns out there is a way to remove the dependency on platform.twitter.com for their Javascript by adding it yourself – https://dev.twitter.com/docs/intents

    Regarding the intermittent in_reply_to links, for some reason the data I attributes I had were adding 1 to the tweet_id that was being passed in the Django context. I’m not sure why, but I went ahead and refactored my code to only dynamically add the text, rather than the tweet id, since that isn’t going to change.

    Now it all works just fine.

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

Sidebar

Related Questions

I have created a UISegmentedControl with two segments using the interface builder (from storyboard),
I have created the simple web service. Code: [ServiceContract] public interface ITsdxService { [OperationContract]
I have created an application that allows users to capture information for entities based
I have WYSIWYG style javascript interface that allows a designer to create rectangular regions
I have provided an interface that allows users to create accounts for an application.
I have created a class, MonitoredCollection<T> , that basically encapsulates/mimics List but allows me
I have an interface that allows users to select a type of childObject. These
I have a logging interface that allows user to subclass a Logger and override
I have a rails application with an administration interface that allows a user CRUD
I'm using Jena. I created an interface that allows to add, modify and remove

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.