twitter账号共享
Sharing your content on Twitter can prove to be extremely valuable in reaching a large audience. There's a ton of different ways to make it easy for a visitor to share your webpage or content via Twitter, but finding a good way to engage people to want to share is most important. To first get started with that, it's best to know the different ways you can do this.
在Twitter上分享您的内容对于吸引大量观众来说非常有价值。 有多种方法可以使访问者通过Twitter轻松共享您的网页或内容,但是找到一种吸引人们想要共享的好方法是最重要的。 首先,最好了解执行此操作的不同方法。
Without a doubt, Twitter Resources are the easiest way to enable your web page to quickly be shared with Twitter. It's as simple as going to a URL and copying-and-pasting their code to generate a Tweet Button on your webpage. It literally will do everything for you such as:
毫无疑问,Twitter资源是使您的网页快速与Twitter共享的最简单方法。 只需访问URL并复制并粘贴其代码以在您的网页上生成Tweet按钮,就很简单。 它实际上将为您做所有事情,例如:
生成您选择的URL或拥有当前URL
自动创建或手动文本选项
(可选)显示推文计数
轻松将标签和用户名添加到推文中
不同样式,例如小号,大号或无推文计数
Here's some examples of what these buttons can look like:
以下是这些按钮的外观示例:
Tweet Tweet Tweet Tweet
推特 推特 推特 推特
Twitter Resource for Tweet Buttons are located here: Tweet Buttons
Twitter按钮的Twitter资源位于: Twitter按钮
This should be pretty common knowledge amongst web developers, and this option is great for bloggers and small blogs who are just trying to dump the option on their webpage.
这对于Web开发人员来说应该是非常普遍的常识,并且对于试图将选项转储到其网页上的博客作者和小型博客来说,此选项非常有用。
In terms of engagement, using these buttons are a win-lose type of situation. These buttons are used over-and-over across many web pages, so they're very familiar to users. When your site visitor finds this button, they'll know exactly what it's going to do. The downside of this is these buttons can come across as spammy to users, and they definitely can pollute your web page's design. I'm sure as you read this you can recall a million websites that overkill the social sharing buttons. The next Twitter tweeting option is way more elegant and only slightly more complex.
就参与度而言,使用这些按钮是双输的情况。 这些按钮在许多网页上反复使用,因此用户非常熟悉它们。 当您的站点访问者找到此按钮时,他们将确切知道它将要做什么。 缺点是这些按钮可能会给用户带来垃圾邮件,并且它们肯定会污染您网页的设计。 我敢肯定,当您阅读本文时,您会想起一百万个过度使用社交共享按钮的网站。 下一个Twitter推文选项更优雅,但稍微复杂一点。
Twitter Intents allow you to completely customize the Twitter Share Button however you want with ease. Twitter intents as described by Twitter are:
Twitter Intents允许您完全自定义Twitter共享按钮,但您可以轻松自如。 Twitter描述的Twitter意图是:
Web Intents provide popup-optimized flows for working with Tweets & Twitter Users: Tweet, Reply, Retweet, Favorite, and Follow. They make it possible for users to interact with Twitter content in the context of your site, without leaving the page or having to authorize a new app just for the interaction. Web intents are mobile friendly, and super easy to implement. In the most laymen terms possible, all this means is Twitter provides URLs for sharing (tweeting, reply, retweeting, favoriting and following). The only one I'll be discussing is the Tweet endpoint but just know that there are other endpoints available.
Web Intent提供了与Tweets和Twitter用户一起使用的弹出窗口优化流程:Tweet,Reply,Retweet,Favorite和Follow。 它们使用户可以在您的网站上下文中与Twitter内容进行交互,而无需离开页面或仅授权用于交互的新应用程序。 Web意图是移动友好的,并且超级易于实现。 用最外行的术语来说,所有这些意味着Twitter提供了用于共享的URL(发帖,回复,转发,收藏和关注)。 我将要讨论的唯一一个是Tweet端点,但只知道还有其他端点可用。
The Tweet endpoint is located here: https://twitter.com/intent/tweet. If you're logged into Twitter you'll see a very basic webpage for Tweeting from, and if you're not logged in, you'll be asked to login just to see the same page. This is great because you can send users here with a simple a
tag:
Tweet端点位于: https : //twitter.com/intent/tweet 。 如果您登录到Twitter,您将看到一个非常基础的Tweeting网页,如果您未登录,则将要求您登录以查看同一页面。 这很棒,因为您可以在此处向用户发送一个简单a
标签:
Tweet this page
The benefit of this is that you can style in any manner that you want using CSS. So you're page can have the most custom Twitter button you can think of. Here's a million examples of people being super creative with it: CodePen Examples
这样做的好处是,您可以使用CSS进行任何样式设置。 因此,您的页面可以具有您可以想到的最自定义的Twitter按钮。 这里有百万个示例说明人们对其具有超强的创造力: CodePen示例
via
(via
)
A screen name to associate with the Tweet. The provided screen name will be appended to the end of the tweet with the text: "via @username" "Via" will be translated to the proper locality of the posting user, if supported. Potentially drives new followers to the target account.
与推文关联的屏幕名称。 提供的屏幕名称将被添加到推文的末尾,并带有以下文本:“ via @username”“ Via”将被翻译为发布用户的正确位置(如果支持)。 潜在地将新关注者带到目标帐户。
https://twitter.com/intent/tweet?via=scotch_io
https://twitter.com/intent/tweet?via=scotch_io
text
(text
)
Pre-prepared, properly UTF-8 & percent-encoded Tweet body text. Users will still be able to edit the pre-prepared text. This field has a potential of 140 characters maximum, but consider the implications of other parameters like url and via.
经过预先准备的,正确的UTF-8和百分比编码的Tweet正文。 用户仍然可以编辑预先准备的文本。 该字段最多可包含140个字符,但请考虑其他参数(例如url和via)的含义。
https://twitter.com/intent/tweet?text=I%20love%20scotch.%20Scotchy,%20scotch,%20scotch.
https://twitter.com/intent/tweet?text=I%20love%20scotch.%20Scotchy、%20scotch、%20scotch。
in_reply_to
(in_reply_to
)
Associate this Tweet with a specific Tweet by indicating its status ID here. The originating Tweet Author's screen name will be automatically prepended to the reply.
通过在此处指示其状态ID,将此推文与特定推文相关联。 原始推文作者的屏幕名称将自动添加到回复中。
https://twitter.com/intent/tweet?in_reply_to=337636810828152833
https://twitter.com/intent/tweet?in_reply_to=337636810828152833
hashtags
(hashtags
)
Add context to the pre-prepared status update by appending #hashtags. Omit the "#" symbol and separate multiple hashtags with commas.
通过附加#hashtags将上下文添加到预先准备的状态更新中。 省略“#”符号,并用逗号分隔多个主题标签。
https://twitter.com/intent/tweet?hashtags=i,love,scotch,scotchy,sc0tch,Scotch
https://twitter.com/intent/tweet?hashtags=i,love,scotch,scotchy,sc0tch,Scotch
related
(related
)
Suggest accounts related to the your content or intention by comma-separating a list of screen names. After Tweeting, the user will be encouraged to follow these accounts.
通过用逗号分隔屏幕名称列表来建议与您的内容或意图有关的帐户。 鸣叫后,将鼓励用户关注这些帐户。
These are amazing options for dynamically generating your tweets on your webpages. Truth be told though, you probably don't need all these dynamic options. These are amazing for constructing and building dynamic Tweet URL endpoints, but sometimes (for me, it's most times) you know exactly what you want to tweet. A great trick or common practice is to just URL encode whatever you want with just the Text GET parameter. This has the added benefit of placing your Hashtags and URL's wherever you want to. So for example, this is how you do it with PHP:
这些是在网页上动态生成推文的绝佳选择。 说实话,您可能不需要所有这些动态选项。 对于构建和构建动态Tweet URL端点,这些功能是惊人的,但是有时候(对我来说,这是大多数时候),您确切地知道您要发布的内容。 一个不错的技巧或通用做法是仅使用Text GET参数对URL进行任何编码。 这具有将标签和URL放置在任意位置的附加好处。 因此,例如,这就是使用PHP的方式:
$text = 'I #love #scotch. The URL https://scotch.io is pretty cool!';
$text = urlencode($text);
$url = 'https://twitter.com/intent/tweet?text='.$text;
Pretty neat and probably very basic for many. You're lastly probably thinking that sending users to a customized Tweet URL is neat, but you don't want them to leave your webpage - so you'll want this to be a popup. The Twitter Intents API provide a ridiculously easy little JS snippet to fix this. Just include the following snippet on your web page, and it will auto-detect any a
tags that link to the Twitter Intent URLs and make them a JavaScript popup:
相当整洁,可能对许多人来说很基础。 您最后可能会认为,将用户发送到自定义的Tweet URL很简单,但是您不希望他们离开您的网页-因此,您希望它成为一个弹出窗口。 Twitter Intents API提供了一个非常简单的JS小片段来解决此问题。 只需在您的网页上下面的代码片段,它会自动检测到任何a
标签链接到Twitter的意图网址,并让他们一个JavaScript弹出:
You'll only need to include this snippet once! The Twitter Resource Buttons use this same script, so just do a simple check to see if this is on the page or not or include it with your regular JS files. Now, all your Twitter Intent links will popup:
您只需要添加一次此代码段! Twitter Resource Buttons使用相同的脚本,因此只需简单检查一下是否在页面上,或将其包含在常规JS文件中即可。 现在,您所有的Twitter Intent链接都会弹出:
Tweet this page with a Pop-Up
Both of these options are great for making it easy for a site visitor to share your content on Twitter. Some people may argue that the first option of good old-fashioned Twitter Buttons yield the most click-throughs because of familiarity, and others may argue the opposite. Either way, I personally choose the second option since you can do whatever you want with it.
这两个选项都非常适合使站点访问者轻松地在Twitter上共享您的内容。 有人可能会说,由于熟悉度高,老式的Twitter Buttons的第一种选择产生的点击率最高,而另一些人则相反。 无论哪种方式,我个人都会选择第二个选项,因为您可以使用它来做任何您想做的事情。
This tutorial is basic -- real basic. I hope it helps some beginners out there or intermediate people out there who may have not known about this. Anyways, I'd love to hear about the ways that you implemented Twitter on your website. Just comment below!
本教程是基础知识-真正的基础知识。 我希望它可以帮助一些初学者或中间人,他们可能对此一无所知。 无论如何,我很想听听您在网站上实施Twitter的方式。 请在下面发表评论!
翻译自: https://scotch.io/tutorials/how-to-share-webpages-with-twitter
twitter账号共享