<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>PowerTweet on Tony McGovern. Hacker. Artist. Storyteller. Data lover.</title>
    <link>/categories/powertweet/index.xml</link>
    <description>Recent content in PowerTweet on Tony McGovern. Hacker. Artist. Storyteller. Data lover.</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <atom:link href="/categories/powertweet/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>PowerTweet: Twitter Data with Power Query</title>
      <link>/blog/introducing-powertweet/</link>
      <pubDate>Mon, 02 Apr 2018 00:00:00 +0000</pubDate>
      
      <guid>/blog/introducing-powertweet/</guid>
      <description>

&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;This post covers many of the options available in &lt;code&gt;PowerTweet: Twitter Data with Power Query&lt;/code&gt;, a &lt;a href=&#34;../../powerquery/twitter/&#34;&gt;series of Power Query/M functions that allow you to interact with Twitter data&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&#34;search-tweets&#34;&gt;Search Tweets&lt;/h3&gt;

&lt;p&gt;Retrieve up to 45,000 tweets when using a search term. Here we search for the 500 most recent tweets that include the &amp;ldquo;powerbi&amp;rdquo; keyword.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;let
    tweets = SearchTweets(&amp;quot;powerbi&amp;quot;, 500, &amp;quot;recent&amp;quot;)
in
    tweets
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;get-friends&#34;&gt;Get Friends&lt;/h3&gt;

&lt;p&gt;Retrieve up to 75,000 ids of users that a target account follows. Here we return the first 150 ids of users that the MSPowerBI Twitter account follows.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;let
    friends = GetFriends(&amp;quot;MSPowerBI&amp;quot;, 150)
in
    friends
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;get-followers&#34;&gt;Get Followers&lt;/h3&gt;

&lt;p&gt;Retrieve up to 75,000 ids of users that follow a target account. Here we return the first 150 ids of users that follow the MSPowerBI Twitter account.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;let
    followers = GetFollowers(&amp;quot;MSPowerBI&amp;quot;, 150)
in
    followers
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;lookup-users&#34;&gt;Lookup Users&lt;/h3&gt;

&lt;p&gt;Returns up to 30,000 user objects specified by comma-separated values passed &lt;code&gt;user_id&lt;/code&gt; parameter. Best used in conjunction with collections of user IDs returned from &lt;code&gt;GetFriends&lt;/code&gt; or &lt;code&gt;GetFollowers&lt;/code&gt;. Here we return the first 150 user ids with the &lt;code&gt;GetFriends&lt;/code&gt; function and then pass those ids to the &lt;code&gt;LookupUsers&lt;/code&gt; function to get a complement of information for those users.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;let
    // Get the first 150 user ids from those that the MSPowerBI Twitter account follows
    friendIds = GetFriends(&amp;quot;MSPowerBI&amp;quot;, 150),
    // Pass these user ids to the LookupUsers function to return a full user object complement
    friendObjects = LookupUsers(Text.Combine(friendIds[id],&amp;quot;,&amp;quot;))
in
    friendObjects
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;get-timeline&#34;&gt;Get Timeline&lt;/h3&gt;

&lt;p&gt;Retrieve up to 300,000 of the most recent tweets that contain the specified user. Here we return the most recent 5,000 user statuses from the MSPowerBI Twitter account timeline.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;let
    statuses = GetTimeline(&amp;quot;MSPowerBI&amp;quot;, 5000),
    RemovedDuplicates = Table.Distinct(statuses, {&amp;quot;id_str&amp;quot;})
in
    RemovedDuplicates
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&#34;powertweet-documentation&#34;&gt;PowerTweet Documentation&lt;/h3&gt;

&lt;p&gt;&lt;a href=&#34;../../powerquery/twitter/&#34;&gt;Navigate you browser here&lt;/a&gt; for more information on how to use &lt;code&gt;PowerTweet&lt;/code&gt;, including code snippets on how to authenticate to the Twitter API and other Power Query Twitter functions.&lt;/p&gt;

&lt;h3 id=&#34;sample-power-bi-report&#34;&gt;Sample Power BI Report&lt;/h3&gt;

&lt;p&gt;The embedded Power BI report below uses many of the functions listed here.
&lt;iframe class=&#34;pre&#34; width=&#34;100%&#34; height=&#34;700&#34; src=&#34;https://app.powerbi.com/view?r=eyJrIjoiODdhNDg3OTItODhmZS00NjFkLWIwODAtNjg2NGU2YzRmOTU4IiwidCI6ImRjNTliNTFkLWVmZDItNDYyNi04M2EyLTljMmU2MzE1MTcwZiIsImMiOjZ9&#34; frameborder=&#34;0&#34; allowFullScreen=&#34;true&#34;&gt;&lt;/iframe&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>