<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Annamalai Selvam on Medium]]></title>
        <description><![CDATA[Stories by Annamalai Selvam on Medium]]></description>
        <link>https://medium.com/@annamalaiselvam?source=rss-6e236916c720------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*SlrPXQjrEdnKYps3nb0n7g.jpeg</url>
            <title>Stories by Annamalai Selvam on Medium</title>
            <link>https://medium.com/@annamalaiselvam?source=rss-6e236916c720------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:30:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@annamalaiselvam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Explore the features of Python]]></title>
            <link>https://medium.com/@annamalaiselvam/explore-the-features-of-python-157beb45edf1?source=rss-6e236916c720------2</link>
            <guid isPermaLink="false">https://medium.com/p/157beb45edf1</guid>
            <category><![CDATA[whatsapp]]></category>
            <category><![CDATA[instagram]]></category>
            <category><![CDATA[médium]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[spotipy]]></category>
            <dc:creator><![CDATA[Annamalai Selvam]]></dc:creator>
            <pubDate>Sun, 06 Oct 2019 12:30:05 GMT</pubDate>
            <atom:updated>2019-10-06T12:30:05.005Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K08uIjz9cuEbAUe08umj_w.jpeg" /></figure><p>In this article, I will explain about some of cool stuffs that are available in Python and also how to use them in your application.</p><p>Python is a beautiful language. Simple to use yet powerfully expressive. But are you using everything that it has to offer?</p><p>The advanced features of any programming language are usually discovered through extensive experience. You’re coding up a complicated project and find yourself searching for something on stackoverflow. You then come across a beautifully elegant solution to your problem that uses a Python feature you never even knew existed!</p><p>That’s totally the funnest way to learn: <em>discovery by exploration and accident!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*grCvrmZdeDld49dfHvoi7A.jpeg" /><figcaption>Oh!! Yes</figcaption></figure><p>Okay, Without wasting any time, let me dive into the features!</p><h3><strong>Spotipy</strong></h3><p>Don’t stare at the heading. Yes, It’s not Spotify. I hope those who read this article may be addicted to the songs.</p><p><strong>Spotipy</strong> is a lightweight Python library for the Spotify Web API. With <em>Spotipy</em> you get full access to all of the music data provided by the Spotify platform.</p><p><strong>Installation</strong></p><blockquote>pip install spotipy</blockquote><p>Here’s a quick example of using <em>Spotipy</em> to list the names of all the albums released by the artist ‘<strong>Zayn Malik</strong>’:</p><pre>import spotipy</pre><pre>zayn_uri = &#39;spotify:artist:2WX2uTcsvV5OnS0inACecP&#39;<br>spotify = spotipy.Spotify()</pre><pre>results = spotify.artist_albums(zayn_uri, album_type=&#39;album&#39;)<br>albums = results[&#39;items&#39;]<br>while results[&#39;next&#39;]:<br>    results = spotify.next(results)<br>    albums.extend(results[&#39;items&#39;])</pre><pre>for album in albums:<br>    print(album[&#39;name&#39;])</pre><h3><strong>Whatsapp</strong></h3><p>Have you ever wished to automatically wish your friends on their birthdays, or send a set of messages to your friend ( or any Whastapp contact! ) automatically at a pre-set time, or send your friends by sending thousands of random text on whatsapp. If yes, then you must install these!</p><p><strong>1) Python Bindings for Selenium ( Browser Automation software )</strong></p><pre>pip install selenium</pre><p><strong>2) Chromium Web Browser( Open source version of chrome browser )</strong></p><pre>sudo apt-get install chromium-browser</pre><p>That’s it! You are all set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*rF_MQR-GuNYt98bG0cz0lQ.png" /><figcaption>Try it out!</figcaption></figure><h3><strong>Instagramming with python</strong></h3><p>Instagram has an official API but it is outdated and is currently very limited in things you can do with it. So in this guide I will use <a href="https://github.com/LevPasha/Instagram-API-python">LevPasha’s Unofficial Instagram API</a>, which supports all major features like like, follow, upload photo and video, etc! It is written in Python, but I will focus only on the data side.</p><p><strong>Installation</strong></p><pre>python -m pip install -e git+https://github.com/LevPasha/Instagram-API-python.git#egg=InstagramAPI</pre><p><strong>Fetch details from Instagram Using the API</strong></p><pre>from InstagramAPI import InstagramAPI<br>username=&quot;YOURUSERNAME&quot;<br>InstagramAPI = InstagramAPI(username, &quot;YOURPASSWORD&quot;)<br>InstagramAPI.login()<br>InstagramAPI.getProfileData()<br>result = InstagramAPI.LastJson<br>print(result[&#39;user&#39;][&#39;full_name&#39;])<br>print(result[&#39;biography&#39;])</pre><p>So, If you execute the above script then user name and biography of the user will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*EDxuMIMRI-H8qxnI9faU-g.png" /><figcaption>I too executed the above script and fetched My Username(bottom 4th),Biography(from bottom 3rd)</figcaption></figure><h3><strong>Medium</strong></h3><p>I was looking through the latest posts from users I follow to see who had responded to those users. I figured that if they responded to someone I’m following, they must have similar interests to mine. So, I wanted to</p><ol><li>Get all the <strong>users</strong> from my “Followings” list</li><li>Get the latest <strong>posts</strong> of each user.</li><li>Get the <strong>username</strong> of the author of each response</li></ol><pre>import requests<br>MEDIUM = &#39;https://medium.com&#39;<br>def get_user_id(username):   <br>    print(&#39;Retrieving user ID...&#39;)    <br>    url = MEDIUM + &#39;/@&#39; + username + &#39;?format=json&#39;<br>    response = requests.get(url)<br>    response_dict = clean_json_response(response)<br>    return response_dict[&#39;payload&#39;][&#39;user&#39;][&#39;userId&#39;]</pre><h3>Getting the latest posts from each user</h3><p>Once I had the list of users I follow, I wanted to get their latest posts. I could do that with a request to <a href="https://medium.com/@username/latest?format=json">https://medium.com/@&lt;username&gt;/latest?format=json</a></p><p>The function will return a list of post IDs for the latest posts from all the usernames on the input list.</p><pre>def get_list_of_latest_posts_ids(usernames):   <br> print(&#39;Retrieving the latest posts...&#39;)    <br> post_ids = []   <br> for username in usernames:<br>        url = MEDIUM + &#39;/@&#39; + username + &#39;/latest?format=json&#39;<br>        response = requests.get(url)<br>        response_dict = clean_json_response(response)      <br>        try:<br>            posts = response_dict[&#39;payload&#39;][&#39;references&#39;][&#39;Post&#39;]<br>        except:<br>            posts = []        <br>            if posts:<br>            for key in posts.keys():<br>                post_ids.append(posts[key][&#39;id&#39;])    <br> return post_ids</pre><h3>Getting the username of the author of each response</h3><p>I grabbed all the authors’ user IDs and user names using the following function.</p><pre>def get_user_ids_from_responses(responses, recommend_min):   <br>    print(&#39;Retrieving user IDs from the responses...&#39;)   <br>    user_ids = []   <br>    for response in responses:<br>        recent = check_if_recent(response)<br>        high = check_if_high_recommends(response, recommend_min)<br>        if recent and high:<br>            user_ids.append(response[&#39;creatorId&#39;])   <br>    return user_ids</pre><pre>def get_usernames(user_ids):   <br>     print(&#39;Retrieving usernames of interesting users...&#39;)        <br>     usernames = []  <br>     for user_id in user_ids:<br>        url = MEDIUM + &#39;/_/api/users/&#39; + user_id<br>        response = requests.get(url)<br>        response_dict = clean_json_response(response)<br>        payload = response_dict[&#39;payload&#39;]          <br>        usernames.append(payload[&#39;value&#39;][&#39;username&#39;])   <br>     return usernames</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OsMC06wRy8VygCmp9H95JA.jpeg" /></figure><h3>In summary…</h3><p>Hope you guys got to know how to integrate the APIs with your application. Moreover, these are just 0.2% features which I have explained. So, still lot more to come in upcoming post.</p><p>Until happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=157beb45edf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sentiment Analysis using Python]]></title>
            <link>https://medium.com/@annamalaiselvam/sentiment-analysis-using-python-ff314f19cdc6?source=rss-6e236916c720------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff314f19cdc6</guid>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[tweet]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Annamalai Selvam]]></dc:creator>
            <pubDate>Sun, 09 Jun 2019 20:29:48 GMT</pubDate>
            <atom:updated>2019-06-10T07:00:49.094Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T12yep8CxGvyaMw0pPD0qA.png" /></figure><h3>Introduction</h3><p>Sentiment analysis has been predominantly used in data science for analysis of customer feedback on products and reviews. It has also become popular to analyses user tweets — positive, negative or neutral by crawling twitter through APIs.</p><h4>“Will you believe ,if I say that the sentiment analysis can be done in just 18 lines of code ? “ Oh,No! Don’t laugh! Until you scroll off this article fully!!</h4><p>Before stepping into the coding process, we need to do couple of installation process.</p><p><strong>Tweepy: </strong>Python client for the official <a href="https://dev.twitter.com/rest/public">Twitter API</a>.</p><blockquote><em>pip install tweepy</em></blockquote><p><strong>TextBlob: </strong>Python library for processing textual data.</p><blockquote><em>pip install textblob</em></blockquote><p><strong>Authentication:<br> </strong>In order to fetch tweets through Twitter API, we need to register an App through their twitter account. Follow these steps for the same:</p><ul><li>Open this<a href="https://apps.twitter.com/"> link</a> and click the button: ‘Create New App’</li><li>Fill the application details. You can leave the callback url field empty.</li><li>Once the app is created, you will be redirected to the app page.</li><li>Open the ‘Keys and Access Tokens’ tab.</li><li>Copy ‘Consumer Key’, ‘Consumer Secret’, ‘Access token’ and ‘Access Token Secret’.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AiVNIURi6WCMY-ofbDSWOg.png" /></figure><p><strong>Implementation:</strong></p><blockquote><em>import tweepy<br>from textblob import TextBlob<br># keys and tokens from the Twitter Dev Console<br>consumer_key = ‘XXXXXXXXXXXXXXXXXXXXXXXX’<br>consumer_secret = ‘XXXXXXXXXXXXXXXXXXXXXXXXXXXX’<br>access_token = ‘XXXXXXXXXXXXXXXXXXXXXXXXXXXX’<br>access_token_secret = ‘XXXXXXXXXXXXXXXXXXXXXXXXX’<br># attempt authentication<br>auth = OAuthHandler(consumer_key, consumer_secret)<br>auth.set_access_token(access_token, access_token_secret)<br># create tweepy API object to fetch tweets<br>api = tweepy.API(auth)<br>tweets=api.search(‘Annamalai’)<br>for t in tweets:<br>analysis = TextBlob(t.text)<br>if analysis.sentiment.polarity &gt; 0:<br>print(‘Happy and Excited !!’)<br>elif analysis.sentiment.polarity == 0:<br>print(‘Unbiased’)<br>else:<br>print(‘Sad’)</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*_wJSifcqZV8M_EX-kuw8Rw.png" /></figure><h3><strong>What’s Coming up next !</strong></h3><p>In upcoming post, I will visualize the output sentiments in different ways.</p><p>Until, Happy Coding !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff314f19cdc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular7 + Firestore + AWS for Task Management Application]]></title>
            <link>https://medium.com/@annamalaiselvam/angular7-and-cloud-firestore-for-task-management-application-20b335cf20a1?source=rss-6e236916c720------2</link>
            <guid isPermaLink="false">https://medium.com/p/20b335cf20a1</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Annamalai Selvam]]></dc:creator>
            <pubDate>Sat, 13 Apr 2019 21:19:30 GMT</pubDate>
            <atom:updated>2019-04-15T06:06:39.821Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TWd-5UTzWLpvIE8h_udb5Q.jpeg" /></figure><h3>Firebase</h3><p>Google announced the release of another Real-time database service on Firebase known as Cloud <a href="https://firebase.google.com/docs/firestore/">Firestore</a>. Cloud Firestore is a cloud-hosted, NoSQL database that your iOS, Android, and web apps can access directly via native SDKs.</p><h3>Angular</h3><p><a href="https://angular.io/docs">Angular</a> is a platform that makes it easy to build applications with the web. Angular combines declarative templates, dependency injection, end to end tooling, and integrated best practices to solve development challenges. Angular empowers developers to build applications that live on the web, mobile, or the desktop.</p><h3>Task Management</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*eZ70ELTCYxZ1995UlDJnXQ.png" /></figure><p>It is a simple and intelligent to-do list that makes it easy to plan your day. Whether it’s for work, school or home, To-Do will help you increase your productivity and decrease your stress levels. It combines intelligent technology and beautiful design to empower you to create a simple daily workflow</p><h4>Firebase setup</h4><p>Create a new Firebase app on <a href="https://console.firebase.google.com/">your Firebase console</a> with your Google Account by clicking on “Add project” and type “project name”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n64O4zAzaYfRKOFvh4ZhgA.jpeg" /></figure><p>Then click on <em>“Add Firebase to your web app”</em>, and copy the config keys into src/environments/environment.ts(do the same for environment-prod.ts), the result should be similar to this (notice that this info will be always available under Authentication tab then click on Web setupa button on the upper-right corner):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*eXdcf01Ywspi7mO1Mhu12A.jpeg" /></figure><p>Go to the Database tab, then Rules and change the rules in this way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*6SQtJBsweVl6-bInHAcwww.jpeg" /></figure><p>Okay, now everything is ready to use Firebase and implement our application.</p><h3>Angular</h3><p>Let’s proceed by creating a new Angular solution (always using the amazing Angular CLI)</p><pre>npm i -g @angular/cli@latest</pre><pre><strong>ng new to-do</strong></pre><p>Now, install firebase using the following command</p><pre>npm i @firebase/firestore</pre><p>Import the modules in src/app/app.module.ts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*BhlFZeg96vPVDiVZia5Eog.jpeg" /></figure><p>Add the following code to <strong>app.component.html</strong></p><blockquote>&lt;input class=”form-control” type=”text” placeholder=”I want to.. “ [(ngModel)]=”taskName”&gt;</blockquote><blockquote>&lt;input class=”form-control” type=”date” [(ngModel)]=”taskDate” &gt;</blockquote><blockquote>&lt;button type=”submit” (click)=”addTask()” class=”btn btn-primary btn-lg”&gt;Add Task&lt;/button&gt;</blockquote><blockquote>&lt;button type=”submit” (click)=”displayTask()” class=”btn btn-primary btn-lg”&gt;Display Task&lt;/button&gt;</blockquote><h4>Storing in firebase</h4><blockquote>addTask() {</blockquote><blockquote>this.firestore.collection(‘collection_name’).doc(doc_id).set({</blockquote><blockquote>name: this.taskName,</blockquote><blockquote>date: this.taskDate</blockquote><blockquote>});</blockquote><p>So, by using this query the values can be passed from Angular to firestore.</p><h4>Retrieving from firebase</h4><blockquote>displayTask(){</blockquote><blockquote>const docRef = this.firestore.collection(‘collection_name’).doc(‘doc_id’);</blockquote><blockquote>docRef.get().subscribe(doc =&gt; {</blockquote><blockquote>console.log(doc.data());</blockquote><blockquote>});}</blockquote><p>The collection can be retrieved from the firestore to our Angular application.</p><h3>Deploying our application to Amazon Web Services</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFl-8wQUENETYLjX5mYWuA.png" /></figure><p>Angular CLI comes with Webpack module builder. Luckily we need exactly this. :) To build the app run this:</p><pre>ng build --prod --aot</pre><h3>Register to Amazon AWS</h3><p>You have to register a new <a href="https://aws.amazon.com/">AWS</a> account if you haven’t any.</p><h3>AWS Lambda &amp; Google Cloud Functions</h3><pre>ng add @ng-toolkit/serverless --provider aws</pre><pre>ng add @ng-toolkit/serverless --provider firebase --firebaseProject [your_project_ID]</pre><pre>npm run build:prod:deploy</pre><p>Project ID can be found in project settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*z_bjuPa_uuG2kkCe1HqHjg.jpeg" /></figure><p>Now, a link will be generated for our application. Once, you click on that our application will be hosted on AWS.</p><p>For more information on Firebase, visit the docs<a href="https://firebase.google.com/docs/"> here</a>.</p><p>Maybe next time I will deepen the interaction between <strong>Cloud Firestore</strong>, <strong>Observables </strong>and <strong>Pipes.</strong></p><p>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20b335cf20a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>