Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
shahriar
instagram-service
Commits
ec32c735
Commit
ec32c735
authored
Aug 22, 2021
by
soheib
Browse files
add is follower status to get likes, comments and add story mention data
parent
4ea17049
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/instagram/instagram.service.ts
View file @
ec32c735
...
...
@@ -139,7 +139,9 @@ export class InstagramService implements OnApplicationBootstrap {
}
else
{
let
newUser
=
await
this
.
userModel
.
create
({
_id
:
new
Types
.
ObjectId
()
_id
:
new
Types
.
ObjectId
(),
username
:
userData
.
username
,
is_follower
:
false
})
await
this
.
storyMentionModel
.
create
({
_id
:
new
Types
.
ObjectId
(),
...
...
src/instagram/instaloader-service/getComments.py
View file @
ec32c735
...
...
@@ -77,7 +77,7 @@ def getComments(db, post, profile):
user_id
=
found_username
[
'_id'
]
else
:
created_user
=
account_col
.
insert_one
({
"username"
:
comment
.
owner
.
username
,
"instagram_user_id"
:
comment
.
owner
.
userid
})
"instagram_user_id"
:
comment
.
owner
.
userid
,
"is_follower"
:
false
})
user_id
=
created_user
.
inserted_id
print
(
comment
.
owner
.
username
,
'added to users'
)
...
...
src/instagram/instaloader-service/getLikes.py
View file @
ec32c735
...
...
@@ -80,7 +80,7 @@ def getLikes(db, post, profile):
user_id
=
found_username
[
'_id'
]
else
:
created_user
=
account_col
.
insert_one
(
{
"username"
:
like
.
username
})
{
"username"
:
like
.
username
,
"is_follower"
:
false
})
user_id
=
created_user
.
inserted_id
print
(
like
.
username
,
'added to users'
)
temp
=
{
"user_id"
:
user_id
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment