Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tweet both URL and Hashtags

Following this example on another thread, I am able to tweet either the URL:

String tweetUrl = "https://twitter.com/intent/tweet?text=PUT TEXT HERE &url="
                        + "https://www.google.com";
Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

which shows up as:

PUT TEXT HERE https://www.google.com

or the hashtags:

String tweetUrl = "https://twitter.com/intent/tweet?text=PUT TEXT HERE &url="
                        + "https://www.google.com &hashtags=android,twitter";
Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

which shows up as:

PUT TEXT HERE #android #twitter

But for some reason, I am unable to show both the URL and the hashtags in the twitter box.

What am I doing wrong?

like image 246
Eternal Learner Avatar asked May 02 '12 22:05

Eternal Learner


People also ask

How do I add a hashtag to my twitter post?

After you click “Tweet,” your tweet will appear in your list of tweets with the hashtag in blue type. Scroll over the hashtag and click on it to go to the page for that hashtag. Your tweet will now appear when other users visit the hashtag page.

How do hashtags work on Twitter?

Then, anybody searching for #wikiHow, #hashtags, or #Twitter would see your tweet. After a hashtag has been created, other Twitter users can use that hashtag in their own tweets to add to the larger conversation about that topic. Hashtags can be as general (#wikiHow) or as specific (#USPresidentialElection2020) as desired.

How do I view all tweets using a hashtag on Twitter?

Click a hashtag in a tweet to view all tweets using that hashtag. A quick scroll through your Twitter field should display a variety of hashtags used by different people you follow. When you click or tap a hashtag, you'll be taken to the search results page that displays other tweets containing that hashtag.

How many hashtags should you hashtag on Twitter?

Over-hashtag. One to two relevant hashtags per Tweet is the sweet spot so you can keep your message concise. It’s best practice to keep every Tweet focused on one specific message, rather than trying to communicate multiple ideas. If you do need to say more, that’s where Tweet threads come in.


1 Answers

Answering my own question: There shouldn't be a space before &hashtags. In other words, the above should be written:

String tweetUrl = "https://twitter.com/intent/tweet?text=PUT TEXT HERE &url="
                        + "https://www.google.com&hashtags=android,twitter";
Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

Hope this helps someone.

like image 68
Eternal Learner Avatar answered Oct 23 '22 18:10

Eternal Learner