{"id":281,"date":"2015-02-11T02:00:00","date_gmt":"2015-02-11T02:00:00","guid":{"rendered":"http:\/\/localhost\/?p=281"},"modified":"2015-12-16T19:45:30","modified_gmt":"2015-12-16T19:45:30","slug":"displaying-the-twitter-feed-within-your-ionic-app","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app","title":{"rendered":"Displaying the Twitter Feed within Your Ionic App"},"content":{"rendered":"<p><em>This is a guest post by Simon Reimler, software developer at arvato Bertelsmann, experienced with iOS, Android, AngularJS, Ionic and Python. Simon often writes about Ionic, web and mobile development. Read more on <a href=\"http:\/\/devdactic.com\/\">Simon&#8217;s Blog, DevDactic<\/a>.<\/em><\/p>\n<p>Getting the Twitter timeline of a user into your Ionic app can be a challenging task. Lucky for us, we can use the simple ngCordova OAuth wrapper previously <a href=\"http:\/\/ionicframework.com\/blog\/oauth-ionic-ngcordova\/\">described by Nic Raboy<\/a> to solve the basic authentication. But what happens after the token authentication?<\/p>\n<p>In this post, I will take things one step further and show you how to authenticate with OAuth, make signed calls to the well documented <a href=\"https:\/\/dev.twitter.com\/rest\/public\">Twitter REST API<\/a>, and parse the home timeline of a user inside your Ionic app.<\/p>\n<p><!--more--><\/p>\n<h3 id=\"setupasimpleapp\">Set Up a Simple App<\/h3>\n<p>We&#8217;ll start with a simple blank Ionic app, install <code>ngCordova<\/code> and <code>ngResource<\/code> (needed for the REST calls later) via the <a href=\"http:\/\/bower.io\/\">bower package manager<\/a> and add a Cordova plugin we will need for the OAuth:<\/p>\n<pre><code class=\"bash\">ionic start devdactic-twitterfeed blank --appname \u201cMy Twitter Feed\u201d\ncd devdactic-twitterfeed\nbower install angular-resource ngCordova --save\ncordova plugin add https:\/\/git-wip-us.apache.org\/repos\/asf\/cordova-plugin-inappbrowser.git\n<\/code><\/pre>\n<p>Additionally, we need the jsSHA Library inside our project, because Twitter requires request signing using HMAC-SHA1. Go to the <a href=\"https:\/\/github.com\/Caligatio\/jsSHA\">jsSHA Github project<\/a>, download it, and copy the <code>sha.js<\/code> file from the archive into the <code>www\/lib\/<\/code> folder of your app.<\/p>\n<p>Now, we need to include all these files inside our <code>index.html<\/code>. Make sure to add the ngCordova file before the cordova.js script tag that is already included! We also already included our services, and later, we will create and add a controller.<\/p>\n<pre><code class=\"html\">&lt;!-- Before cordova.js --&gt;\n&lt;script src=&quot;lib\/sha.js&quot;&gt;&lt;\/script&gt;\n&lt;script src=&quot;lib\/angular-resource\/angular-resource.js&quot;&gt;&lt;\/script&gt;\n&lt;script src=&quot;lib\/ngCordova\/dist\/ng-cordova.js&quot;&gt;&lt;\/script&gt;\n\n&lt;!-- After cordova.js --&gt;\n&lt;script src=&quot;js\/controllers.js&quot;&gt;&lt;\/script&gt;\n&lt;script src=&quot;js\/services.js&quot;&gt;&lt;\/script&gt;\n<\/code><\/pre>\n<p>Finally, we must add the dependencies to our AngularJS module inside our <code>app.js<\/code> file:<\/p>\n<pre><code class=\"javascript\">angular.module(&#039;starter&#039;, [&#039;ionic&#039;, &#039;ngResource&#039;, &#039;ngCordova&#039;])\n<\/code><\/pre>\n<p>Our app is now ready to connect with Twitter. The last thing we must do is to create an app on Twitter that will give us the credentials we need. Go to the <a href=\"https:\/\/apps.twitter.com\/\">Twitter Application Management<\/a> page and create a simple app.<\/p>\n<p>After creation, we need to change the callback URL of our Twitter app to <em>http:\/\/localhost\/callback<\/em>. As this is currently not possible via Twitter, make yourself a <a href=\"http:\/\/tinyurl.com\/\">tiny URL<\/a>, and insert that one instead.<br \/>\nLeave the created app for now; we will need to copy some keys from it in a later step.<\/p>\n<h3 id=\"writingatwitterservice\">Writing a Twitter Service<\/h3>\n<p>The heart of our app will be the <code>TwitterService<\/code>, which will handle our calls to the REST API and give us the data we need. Therefore, create a new file named <code>services.js<\/code> next to the <code>app.js<\/code> file, and insert this (I will discuss the functions in detail afterwards):<\/p>\n<pre><code class=\"javascript\">.factory(&#039;TwitterService&#039;, function($cordovaOauth, $cordovaOauthUtility, $http, $resource, $q) {\n    \/\/ 1\n    var twitterKey = &quot;STORAGE.TWITTER.KEY&quot;;\n    var clientId = &#039;TwitterAppConsumerKey&#039;;\n    var clientSecret = &#039;TwitterAppConsumerSecret&#039;;\n\n    \/\/ 2\n    function storeUserToken(data) {\n        window.localStorage.setItem(twitterKey, JSON.stringify(data));\n    }\n\n    function getStoredToken() {\n        return window.localStorage.getItem(twitterKey);\n    }\n\n    \/\/ 3\n    function createTwitterSignature(method, url) {\n        var token = angular.fromJson(getStoredToken());\n        var oauthObject = {\n            oauth_consumer_key: clientId,\n            oauth_nonce: $cordovaOauthUtility.createNonce(10),\n            oauth_signature_method: &quot;HMAC-SHA1&quot;,\n            oauth_token: token.oauth_token,\n            oauth_timestamp: Math.round((new Date()).getTime() \/ 1000.0),\n            oauth_version: &quot;1.0&quot;\n        };\n        var signatureObj = $cordovaOauthUtility.createSignature(method, url, oauthObject, {}, clientSecret, token.oauth_token_secret);\n        $http.defaults.headers.common.Authorization = signatureObj.authorization_header;\n    }\n\n    return {\n        \/\/ 4\n        initialize: function() {\n            var deferred = $q.defer();\n            var token = getStoredToken();\n\n            if (token !== null) {\n                deferred.resolve(true);\n            } else {\n                $cordovaOauth.twitter(clientId, clientSecret).then(function(result) {\n                    storeUserToken(result);\n                    deferred.resolve(true);\n                }, function(error) {\n                    deferred.reject(false);\n                });\n            }\n            return deferred.promise;\n        },\n        \/\/ 5\n        isAuthenticated: function() {\n            return getStoredToken() !== null;\n        },\n        \/\/ 6\n        getHomeTimeline: function() {\n            var home_tl_url = &#039;https:\/\/api.twitter.com\/1.1\/statuses\/home_timeline.json&#039;;\n            createTwitterSignature(&#039;GET&#039;, home_tl_url);\n            return $resource(home_tl_url).query();\n        },\n        storeUserToken: storeUserToken,\n        getStoredToken: getStoredToken,\n        createTwitterSignature: createTwitterSignature\n    };\n});\n<\/code><\/pre>\n<ol>\n<li>\n<p>Insert your personal <code>Consumer<\/code> and <code>Consumer Secret Key<\/code> from the Twitter app you created in the preparation step. The Storage key is just for your localStorage, so change it to whatever you like.<\/p>\n<\/li>\n<li>\n<p>The first two functions are just for storing and retrieving the OAuth Token once the user is successfully authorized; nothing special here.<\/p>\n<\/li>\n<li>\n<p><code>createTwitterSignature<\/code> is one of the most important functions here, because this function takes care of the correct signing of our requests. When called, we give it the HTTP method, like <code>GET<\/code> or <code>POST<\/code>, and the URL from which we want to get the data. The function will then read the OAuth Token from localStorage and create an object with some more general stuff the Twitter REST API requires, like the Consumer Key and the OAuth Token. This object is then passed to the <code>$cordovaOauthUtility<\/code>of ngCordova to create a correct authorization object, which will be set as the <em>authorization header<\/em> of our request. For more detailed information about OAuth 1.0a, check out <a href=\"https:\/\/blog.nraboy.com\/2014\/11\/understanding-request-signing-oauth-1-0a-providers\/\">Nic Raboy&#8217;s blog post<\/a>!<\/p>\n<\/li>\n<li>\n<p>After this function, we come to the returned object of our TwitterService. The <code>initialize<\/code> function will be called on our app startup. This function looks for a stored OAuth token that could be used for signing, but if it is not present, it will try to authorize the user with the help of <code>$cordovaOauth<\/code>, where we again need the Consumer Key and Consumer Secret.<br \/>\nThis ngCordova wrapper will slide up a Twitter authorization form to the user, where the user must enter his\/her credentials. Finally, we return a promise from this function to get informed about a correct\/failed authorization in our controller.<\/p>\n<\/li>\n<li>\n<p>The <code>isAuthenticated<\/code> function is very simple and only checks for a stored token. Keep in mind that users could revoke their permissions for an app, so here you might add a token verification check in a real app.<\/p>\n<\/li>\n<li>\n<p>Finally the <code>getHomeTimeline<\/code> function can be called to retrieve our home timeline feed. Here, we create our signature for the request for the associated URL and return the request as a resource object. To learn more about this, check out my <a href=\"http:\/\/devdactic.com\/improving-rest-with-ngresource\/\">ngResource blog post<\/a>.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"accessingthedatafromourcontroller\">Accessing the data from our Controller<\/h3>\n<p>After we have our service, we need to create the controller for our app, so go ahead and create a controllers.js. Now, open your created file, and insert this:<\/p>\n<pre><code class=\"javascript\">.controller(&#039;AppCtrl&#039;, function($scope, $ionicPlatform, TwitterService) {\n    \/\/ 1\n    $scope.correctTimestring = function(string) {\n        return new Date(Date.parse(string));\n    };\n    \/\/ 2\n    $scope.showHomeTimeline = function() {\n        $scope.home_timeline = TwitterService.getHomeTimeline();\n    };\n    \/\/ 3\n    $scope.doRefresh = function() {\n        $scope.showHomeTimeline();\n        $scope.$broadcast(&#039;scroll.refreshComplete&#039;);\n    };\n    \/\/ 4\n    $ionicPlatform.ready(function() {\n        if (TwitterService.isAuthenticated()) {\n            $scope.showHomeTimeline();\n        } else {\n            TwitterService.initialize().then(function(result) {\n                if(result === true) {\n                    $scope.showHomeTimeline();\n                }\n            });\n        }\n    });\n});\n<\/code><\/pre>\n<p>Our controller is rather simple now, as we have all our REST interaction logic inside our service. Anyway, let\u2019s take a closer look at our functions:<\/p>\n<ol>\n<li>\n<p>As our feed object from Twitter returns a quite unformatted date string, we need to convert the string to a more readable date to display.<\/p>\n<\/li>\n<li>\n<p>The <code>showHomeTimeline<\/code> function will fill our <code>home_timeline<\/code> array with the feed data we get from our service.<\/p>\n<\/li>\n<li>\n<p>As we will have a pull-to-refresh inside our view, we need a function to update the feeds array.<\/p>\n<\/li>\n<li>\n<p>When our platform is ready, we check if the user is already authenticated and initially fill the array. If not, we call our <code>initialize<\/code> from the service to show the login view to the user to perform the OAuth authentication.<\/p>\n<\/li>\n<\/ol>\n<p>That&#8217;s pretty much everything we need for a simple Twitter feed!<\/p>\n<h3 id=\"showingfeedsinsideourview\">Showing Feeds Inside Our View<\/h3>\n<p>After we have a service to get the data from Twitter and a controller to hold our received data, we need an appropriate view to show the feeds in a Twitter-like style. For this, open the <code>index.html<\/code> and replace the dummy body with this:<\/p>\n<pre><code class=\"html\">&lt;body ng-app=&quot;starter&quot; ng-controller=&#039;AppCtrl&#039;&gt;\n  &lt;ion-pane&gt;\n    &lt;ion-header-bar class=&quot;bar-positive&quot;&gt;\n      &lt;h1 class=&quot;title&quot;&gt;My Twitter Feed&lt;\/h1&gt;\n    &lt;\/ion-header-bar&gt;\n    &lt;ion-content class=&quot;has-header padding&quot;&gt;\n      &lt;ion-refresher on-refresh=&quot;doRefresh()&quot;&gt;&lt;\/ion-refresher&gt;\n\n    &lt;div ng-show=&quot;home_timeline.length == 0&quot;&gt;Loading tweets...&lt;\/div&gt;\n\n    &lt;div ng-repeat=&quot;entry in home_timeline&quot; class=&quot;list card&quot;&gt;\n      &lt;div class=&quot;item item-avatar&quot;&gt;\n        &lt;img ng-src=&quot;{{entry.user.profile_image_url}}&quot;\/&gt;\n        &lt;h2&gt;{{entry.user.name}}&lt;\/h2&gt;\n        &lt;p&gt;{{correctTimestring(entry.created_at) | date:&#039;medium&#039;}}&lt;\/p&gt;\n      &lt;\/div&gt;\n\n      &lt;div class=&quot;item item-body&quot;&gt;\n        &lt;p ng-bind-html=&quot;entry.text&quot;&gt;&lt;\/p&gt;\n        &lt;img ng-if=&quot;entry.extended_entities&quot; ng-src=&quot;{{ entry.extended_entities.media[0].media_url }}&quot; style=&quot;width: 100%;&quot;\/&gt;\n      &lt;\/div&gt;\n\n    &lt;\/div&gt;\n  &lt;\/ion-content&gt;\n&lt;\/ion-pane&gt;\n&lt;\/body&gt;\n<\/code><\/pre>\n<p>Inside our view, we first have the refresher, which allows us to use pull-to-refresh. Next, if our feed&#8217;s array is empty, we just display a little dummy text.<\/p>\n<p>The main part is the <code>ng-repeat<\/code> to iterate over the feed objects. Here, we make use of the <a href=\"http:\/\/ionicframework.com\/docs\/components\/#cards\">Ionic cards<\/a>, where we have the profile image of the user as an item-avatar, the username, our corrected time string in the top area, and inside the body of our card the text of the tweet. Additionally, if some media inside the feed data is set, we display the posted image below the content.<\/p>\n<h3 id=\"finalwordsandoutlook\">Final Words and Outlook<\/h3>\n<p>This tutorial shows a straightforward way to display Twitter feed data in an appropriate way inside your Ionic app. There are many more endpoints in the Twitter REST API, so make use of the newly created TwitterService and get the data you need!<br \/>\nAdditionally, you could parse the feed data a bit more through a filter to make links clickable. Check out <a href=\"http:\/\/devdactic.com\/\">my blog<\/a> for an upcoming post about this topic!<\/p>\n<p>If you have any questions, issues, or ideas, please leave a comment below and\/or follow me <a href=\"https:\/\/twitter.com\/schlimmson\">@schlimmson<\/a> on Twitter.<\/p>\n<p>A video version of this article can be seen below.<\/p>\n<p><iframe loading=\"lazy\" width=\"100%\" height=\"510\" data-src=\"\/\/www.youtube.com\/embed\/VE2mbQPQZwA\" frameborder=\"0\" allowfullscreen=\"\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a guest post by Simon Reimler, software developer at arvato Bertelsmann, experienced with iOS, Android, AngularJS, Ionic and Python. Simon often writes about Ionic, web and mobile development. Read more on Simon&#8217;s Blog, DevDactic. Getting the Twitter timeline of a user into your Ionic app can be a challenging task. Lucky for us, [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"","publish_post_category":"","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"","discourse_permalink":"","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[3],"class_list":["post-281","post","type-post","status-publish","format-standard","hentry","category-all","tag-ionic"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Displaying the Twitter Feed within Your Ionic App - Ionic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Displaying the Twitter Feed within Your Ionic App\" \/>\n<meta property=\"og:description\" content=\"This is a guest post by Simon Reimler, software developer at arvato Bertelsmann, experienced with iOS, Android, AngularJS, Ionic and Python. Simon often writes about Ionic, web and mobile development. Read more on Simon&#8217;s Blog, DevDactic. Getting the Twitter timeline of a user into your Ionic app can be a challenging task. Lucky for us, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-11T02:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-16T19:45:30+00:00\" \/>\n<meta name=\"author\" content=\"Simon Grimm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@schlimmson\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon Grimm\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app\"},\"author\":{\"name\":\"Simon Grimm\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/24d44b251756bd6488dcb741eec0bef6\"},\"headline\":\"Displaying the Twitter Feed within Your Ionic App\",\"datePublished\":\"2015-02-11T02:00:00+00:00\",\"dateModified\":\"2015-12-16T19:45:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app\"},\"wordCount\":1175,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"keywords\":[\"Ionic\"],\"articleSection\":[\"All\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app\",\"url\":\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app\",\"name\":\"Displaying the Twitter Feed within Your Ionic App - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"datePublished\":\"2015-02-11T02:00:00+00:00\",\"dateModified\":\"2015-12-16T19:45:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Displaying the Twitter Feed within Your Ionic App\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/24d44b251756bd6488dcb741eec0bef6\",\"name\":\"Simon Grimm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/08\/simon-150x150.jpg\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/08\/simon-150x150.jpg\",\"caption\":\"Simon Grimm\"},\"sameAs\":[\"https:\/\/x.com\/schlimmson\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/schlimmson\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Displaying the Twitter Feed within Your Ionic App - Ionic Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app","og_locale":"en_US","og_type":"article","og_title":"Displaying the Twitter Feed within Your Ionic App","og_description":"This is a guest post by Simon Reimler, software developer at arvato Bertelsmann, experienced with iOS, Android, AngularJS, Ionic and Python. Simon often writes about Ionic, web and mobile development. Read more on Simon&#8217;s Blog, DevDactic. Getting the Twitter timeline of a user into your Ionic app can be a challenging task. Lucky for us, [&hellip;]","og_url":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app","og_site_name":"Ionic Blog","article_published_time":"2015-02-11T02:00:00+00:00","article_modified_time":"2015-12-16T19:45:30+00:00","author":"Simon Grimm","twitter_card":"summary_large_image","twitter_creator":"@schlimmson","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Simon Grimm","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app"},"author":{"name":"Simon Grimm","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/24d44b251756bd6488dcb741eec0bef6"},"headline":"Displaying the Twitter Feed within Your Ionic App","datePublished":"2015-02-11T02:00:00+00:00","dateModified":"2015-12-16T19:45:30+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app"},"wordCount":1175,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"keywords":["Ionic"],"articleSection":["All"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app","url":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app","name":"Displaying the Twitter Feed within Your Ionic App - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"datePublished":"2015-02-11T02:00:00+00:00","dateModified":"2015-12-16T19:45:30+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/displaying-the-twitter-feed-within-your-ionic-app#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Displaying the Twitter Feed within Your Ionic App"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/24d44b251756bd6488dcb741eec0bef6","name":"Simon Grimm","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/08\/simon-150x150.jpg","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/08\/simon-150x150.jpg","caption":"Simon Grimm"},"sameAs":["https:\/\/x.com\/schlimmson"],"url":"https:\/\/ionic.io\/blog\/author\/schlimmson"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=281"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/281\/revisions"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}