0% found this document useful (0 votes)
13 views9 pages

Work Experiance With Hemal Uncle

The document outlines a project focused on extracting and analyzing data related to Artificial Intelligence from Instagram posts using Python and PostgreSQL. It discusses the significance of social media data, the process of using the Instagram API, and the steps for data cleaning and preprocessing to derive insights from user sentiments. The aim is to leverage this data for understanding public opinions and trends surrounding AI on social media.

Uploaded by

shahp248.304
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views9 pages

Work Experiance With Hemal Uncle

The document outlines a project focused on extracting and analyzing data related to Artificial Intelligence from Instagram posts using Python and PostgreSQL. It discusses the significance of social media data, the process of using the Instagram API, and the steps for data cleaning and preprocessing to derive insights from user sentiments. The aim is to leverage this data for understanding public opinions and trends surrounding AI on social media.

Uploaded by

shahp248.304
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 9

Analysing Instagram posts with Python

and PostgreSQL

Everyday there are extortionate amount of data being produced


worldwide from various different forms such as media,
entertainment content, news and personal data. All of these
different consumed data can be presented in a varied way; in
the form of short concise videos such tok-toks / reels, in the
form of elaborate and detailed blogs, or even long,
documented videos such as podcasts. In this case I will be
demonstrating how to extract data regarding Artificial
intelligence from Instagram posts and storing it into a
database to processing the data and preparing it for analysis
tasks, I will analyse this data, and look for patterns and also the
reasoning behind each of the sentiments (feelings / opinions),
this is all for analysing different trending topics in social media,
which I have chosen my platform choice as Instagram, based
on the very trending yet controversial topic of Artificial
intelligence.

Table of Contents
 What we want to achieve here
 What is an API
 Creating Instagram Developer Account
 Limitations of Instagram API
 Authenticating the Instagram API
 Analysing Streamed Tweets
 Data Cleaning and Preprocessing
 Use data to be accurately presented on excel

Heres a detailed overview of what we are going to do:


What we want to achieve here
Not even 100 years ago humanity was still using prehistoric methods of
communications, such as simple mails, letters landline telephones and
now we are sending out messages and calling on social media like its
absolutely nothing, its crazy to think that the data we share has been
exponentially growing in the last few decades than it ever has since we
humans have ever lived. The methods of communication your
grandpatrents may have used is diveregent to the ways we communicate
noe adays. So for this reason I had thought of one of the most populist

social media platoforms out there to be Instagram. Not only do teenagers


use it but even older adults use it to , it has a large age range of users
worldwide, thus the data being produced and shared would be a great
thing to analyse for this research.
Instagram is like a large pot of gold when it comes to sentimental data
regarding any sort of trentding topic, even a single # topic can have
millions if not even a billion posts and likes, so without a doubt it’s an
undoubtley great place for people of all ages to share their opinions about
something. Heeding the number of different posts with likes and
comments imagine how much sheer information we can have if we extract
this and analyse these posts and based of analysis create a fairly judged
graph of data presentation, this can inform us how people may feel about
current affaris happing in this present. Businesses can leverage this
information about how the public is reacting to their product. Investors
can determine how a stock is going to perform and so much more.
Here I plan to extract data from posts regarding artificial intellignence and
find out about peoples sentiment, from specific keywords as well as using
simple computational thinking of abstraction and decomposition to find
out what type of keywords are being used for such trending topics in
social media and why the world thinks as such, ased of these data I getr I
will present it all and thus we can make an appropriate conclusion

What is an API
An API (Application Programming Interface) is like a waiter in a
restaurant. Imagine social media as a restaurant, and the API is the waiter
who takes your order (your request), tells the kitchen (the server) what
you want, and then brings the food (the response) back to you.So similarly
to a client server network or even a restaurant, the client (you) can send
queries or requests from the social media api, which then can provide you
with the data you may need via the APIs database

For example, when you use a social media app, an API lets the app get
your friend's latest posts from the social media server and show them to
you. This makes it easy for different apps to talk to each other and share
information. For instance, Facebook launched version 1.0 of its API in
August of 2006, which allowed developers to access Facebook users'
friends, photos, events, and profile information. This API played a crucial
role in establishing Facebook as one of the most popular social networks
in the world. Instagram Basic Display API is an HTTP-based API that
Facebook apps can use to get an Instagram user's profile, images, videos,
and albums.

Creating Instagram Developer Account


You can login to any social media API by literally googling the social media
name + “API”, then you can sign in via your social media account. This will
then allow you to connect to the social media API where you can use
python and postegreSQL to ask for data. However you may find yourself in
a bit of an issue as there are multiple Instagram APIS, the regular
Instagram api, which is meant for Instagram business accounts and
Instagram creators and also the Instagram basic displays API meant for
regular Instagram accounts for normal users.
Step by step tutorial:
1. Go to Instagram developer page

2. Click on Register Your Application


3. Click on Register a New Client
4. Fill the form and click on Register
5. Go to Clients manager.

6. Click on Manage in your application block.


7. Copy and save your credentials: Client ID and Client Secret

The Instagram Basic Display API allows users of your app to get basic
profile information, photos, and videos in their Instagram accounts. The
API can be used to access any type of Instagram account but only
provides read-access to basic data. Common uses can be Get
an Instagram User Access Token and permissions from an Instagram user,
Get an Instagram user’s profile..Also To Get an Instagram user’s images,
videos, and albums. Once you have registered your app, you will be
provided with an API access key and API secret key. Store these keys in a
safe place because they will only be generated once and you will need
them, again and again, to connect to the API

Limitations of the Instagram API


Although you can retrieve lots of data from the Instagram API, we must
address some of the crucial drawbacks that are there. Some of these
drawbacks can include that there are strict rate limits allowing a limited
number of requests per user per hour of data like instagram posts to be
accessed. Although the API shows only real time data, with limited access
to historical data. Past data retrieval is restricted and often requires
specific permissions or is unavailable through the Api.

Authenticating the Instagram API

Or you may also get an Authorization Window which allows your app to
get Authorization Codes and permissions from app users. Authorization
Codes can be exchanged for Instagram User Access Tokens, which must
be included when querying an app user's profile or their media.

It may look a little like this:


Authorization Codes can be exchanged for short-lived Instagram User
Access Tokens. To get an Authorization Code, implement the Authorization
Window into your app. After an app user authenticates their identity
through the window and grants your app any permissions it needs, we will
redirect the user to your app and include an Authorization Code. You can
then use the API to exchange the code for the app user's short-
lived Instagram User Access Token.
Authorization Codes are short-lived and are only valid for 1 hour.
Analysing Streamed Tweets
For example we have one Instagram post here which shows a video of the
latest chatgpt version chat gpt – 4o, which has a live speech model, which
is capable of working end-to-end with speech-to-speech. It listens to the
audio rather than transcribing the speech first.Here we can analyse some
of these posts by looking at the top 10 comments from the post and
reviewing it to see how well everyones sentiment is.

Data Cleaning and Preprocessing


This section is all to do with removing the unnecessary and irrelevant
information from the Instagram posts, additionally we should also
acknowledge the use of using emojis and hashtags in the Instagram post
to understand the sentiment further along. Another method you can call
this is using abstraction as they call it in computational science where you
will only need to highlight the most important parts of an image or a
system and filter out the irrelevant parts.

In this case for this Instagram


post we can see the user has
published this post with a
caption which we can qote
using abstraction and data
processing as “here in
Maldives enjoying the sunset
on a beach”. In this case we
have removed the chasing
sunsets and goodvibes part as
its not necessary. Additionally
we get emojis s=which directly
indicate to us how the user
feels about the post and the
content regrading the post in
which this case its all positive.

#
As you can see here the implementation of hashtags are used
to show the different sentiments of the users post. Relating to
stuff such as beaches and vibes, which indicate this person is
enjoying their time on the beach

Use data to be accurately presented on excel

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy