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
c22fd7fd
Commit
c22fd7fd
authored
Aug 14, 2021
by
velayat
Browse files
soheib cant push his changes so i did it for him
parent
c670bdce
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
src/app.controller.ts
View file @
c22fd7fd
import
{
Body
,
Controller
,
Get
,
Post
}
from
'
@nestjs/common
'
;
import
{
Body
,
Controller
,
Get
,
Post
}
from
'
@nestjs/common
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
AppService
}
from
'
./app.service
'
;
@
Controller
()
@
Controller
()
export
class
AppController
{
export
class
AppController
{
constructor
(
private
readonly
appService
:
AppService
)
{
}
constructor
(
private
readonly
appService
:
AppService
)
{
}
}
}
// @Get('get-followers')
// @Get('get-followers')
// async getFollowers() {
// async getFollowers() {
// return await this.appService.getFollowers();
// return await this.appService.getFollowers();
// }
// }
// @Post()
// @Post()
// async getUserScore(@Body() getUserScoreDto: GetUserScore) {
// async getUserScore(@Body() getUserScoreDto: GetUserScore) {
// return await this.appService.calculateUserScore(getUserScoreDto.username);
// return await this.appService.calculateUserScore(getUserScoreDto.username);
// }
// }
// @Get('calculate-result')
// @Get('calculate-result')
// async calculateResult() {
// async calculateResult() {
// return await this.appService.getResults();
// return await this.appService.getResults();
// }
// }
// @Get('get-results')
// @Get('get-results')
// async getResults() {
// async getResults() {
// return await this.appService.getFinalResults();
// return await this.appService.getFinalResults();
// }
// }
// @Post('search')
// @Post('search')
// async getUserResults(@Body('username') username: string) {
// async getUserResults(@Body('username') username: string) {
// return await this.appService.getUserResult(username);
// return await this.appService.getUserResult(username);
// }
// }
// @Get('shuffle')
// @Get('shuffle')
// async shuffle() {
// async shuffle() {
// return await this.appService.getShuffleData();
// return await this.appService.getShuffleData();
// }
// }
// @Get('add-lottory-result')
// @Get('add-lottory-result')
// async addResultDb() {
// async addResultDb() {
// return await this.appService.addResultsToDB();
// return await this.appService.addResultsToDB();
// }
// }
src/app.module.ts
View file @
c22fd7fd
import
{
Module
}
from
'
@nestjs/common
'
;
import
{
Module
}
from
'
@nestjs/common
'
;
import
{
MongooseModule
}
from
'
@nestjs/mongoose
'
;
import
{
MongooseModule
}
from
'
@nestjs/mongoose
'
;
import
{
AppController
}
from
'
./app.controller
'
;
import
{
AppController
}
from
'
./app.controller
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
InstagramModule
}
from
'
./instagram/instagram.module
'
;
import
{
InstagramModule
}
from
'
./instagram/instagram.module
'
;
import
{
LotteryModule
}
from
'
./lottery/lottery.module
'
;
import
{
LotteryModule
}
from
'
./lottery/lottery.module
'
;
import
{
InstagramService
}
from
'
./instagram/instagram.service
'
;
import
{
InstagramService
}
from
'
./instagram/instagram.service
'
;
import
{
UserSchema
}
from
'
./instagram/models/user.schema
'
import
{
UserSchema
}
from
'
./instagram/models/user.schema
'
import
{
FollowerSchema
}
from
'
./instagram/models/follower.schema
'
import
{
FollowerSchema
}
from
'
./instagram/models/follower.schema
'
import
{
LikeSchema
}
from
'
./instagram/models/like.schema
'
import
{
LikeSchema
}
from
'
./instagram/models/like.schema
'
import
{
CommentSchema
}
from
'
./instagram/models/comment.schema
'
import
{
CommentSchema
}
from
'
./instagram/models/comment.schema
'
import
{
LottoryResultSchema
}
from
'
./instagram/models/LottoryResult.schema
'
import
{
LottoryResultSchema
}
from
'
./instagram/models/LottoryResult.schema
'
@
Module
({
@
Module
({
imports
:
[
imports
:
[
MongooseModule
.
forRoot
(
MongooseModule
.
forRoot
(
'
mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256&connectTimeoutMS=10000&readPreference=primary&serverSelectionTimeoutMS=5000&appname=MongoDB%20Compass&directConnection=true&ssl=false
'
,
'
mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256&connectTimeoutMS=10000&readPreference=primary&serverSelectionTimeoutMS=5000&appname=MongoDB%20Compass&directConnection=true&ssl=false
'
,
),
),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
User
'
,
schema
:
UserSchema
},
{
name
:
'
User
'
,
schema
:
UserSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
Follower
'
,
schema
:
FollowerSchema
},
{
name
:
'
Follower
'
,
schema
:
FollowerSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
Like
'
,
schema
:
LikeSchema
},
{
name
:
'
Like
'
,
schema
:
LikeSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
Comment
'
,
schema
:
CommentSchema
},
{
name
:
'
Comment
'
,
schema
:
CommentSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
LottryResult
'
,
schema
:
LottoryResultSchema
},
{
name
:
'
LottryResult
'
,
schema
:
LottoryResultSchema
},
]),
]),
InstagramModule
,
InstagramModule
,
LotteryModule
,
LotteryModule
,
],
],
controllers
:
[
AppController
],
controllers
:
[
AppController
],
providers
:
[
AppService
,
InstagramService
],
providers
:
[
AppService
,
InstagramService
],
})
})
export
class
AppModule
{
}
export
class
AppModule
{
}
src/app.service.ts
View file @
c22fd7fd
This diff is collapsed.
Click to expand it.
src/instagram/dto/get-comments-dto.ts
View file @
c22fd7fd
export
class
GetCommentsDto
{
export
class
GetCommentsDto
{
username
:
string
username
:
string
password
:
string
password
:
string
profile
:
string
profile
:
string
post_short_code
:
string
post_short_code
:
string
}
}
\ No newline at end of file
src/instagram/dto/get-followers-dto.ts
View file @
c22fd7fd
export
class
GetFollowersDto
{
export
class
GetFollowersDto
{
username
:
string
username
:
string
password
:
string
password
:
string
profile
:
string
profile
:
string
}
}
\ No newline at end of file
src/instagram/dto/get-likes-dto.ts
View file @
c22fd7fd
export
class
GetLikesDto
{
export
class
GetLikesDto
{
username
:
string
username
:
string
password
:
string
password
:
string
profile
:
string
profile
:
string
post_short_code
:
string
post_short_code
:
string
}
}
\ No newline at end of file
src/instagram/instagram.controller.ts
View file @
c22fd7fd
import
{
Body
,
Controller
,
Get
,
Param
,
Post
}
from
'
@nestjs/common
'
;
import
{
Body
,
Controller
,
Get
,
Param
,
Post
}
from
'
@nestjs/common
'
;
import
{
GetCommentsDto
}
from
'
./dto/get-comments-dto
'
import
{
GetCommentsDto
}
from
'
./dto/get-comments-dto
'
import
{
GetFollowersDto
}
from
'
./dto/get-followers-dto
'
import
{
GetFollowersDto
}
from
'
./dto/get-followers-dto
'
import
{
GetLikesDto
}
from
'
./dto/get-likes-dto
'
import
{
GetLikesDto
}
from
'
./dto/get-likes-dto
'
import
{
InstagramService
}
from
'
./instagram.service
'
import
{
InstagramService
}
from
'
./instagram.service
'
@
Controller
(
'
instagram
'
)
@
Controller
(
'
instagram
'
)
export
class
InstagramController
{
export
class
InstagramController
{
constructor
(
private
instagramService
:
InstagramService
)
{
}
constructor
(
private
instagramService
:
InstagramService
)
{
}
@
Get
(
'
get-json-followers
'
)
@
Get
(
'
get-json-followers
'
)
async
getJsonDataFollowers
()
{
async
getJsonDataFollowers
()
{
await
this
.
instagramService
.
getFollowersFromJsonData
()
await
this
.
instagramService
.
getFollowersFromJsonData
()
return
"
proccess started successfully
"
return
"
proccess started successfully
"
}
}
@
Post
(
'
get-followers
'
)
@
Post
(
'
get-followers
'
)
async
getFollowers
(@
Body
()
getFollowers
:
GetFollowersDto
)
{
async
getFollowers
(@
Body
()
getFollowers
:
GetFollowersDto
)
{
return
await
this
.
instagramService
.
getFollowersFromInstaLoader
(
getFollowers
.
username
,
return
await
this
.
instagramService
.
getFollowersFromInstaLoader
(
getFollowers
.
username
,
getFollowers
.
password
,
getFollowers
.
profile
)
getFollowers
.
password
,
getFollowers
.
profile
)
}
}
@
Post
(
'
get-likes
'
)
@
Post
(
'
get-likes
'
)
async
getLikes
(@
Body
()
getLikes
:
GetLikesDto
)
{
async
getLikes
(@
Body
()
getLikes
:
GetLikesDto
)
{
return
this
.
instagramService
.
getLikesFromInstaLoader
(
getLikes
.
username
,
return
this
.
instagramService
.
getLikesFromInstaLoader
(
getLikes
.
username
,
getLikes
.
password
,
getLikes
.
post_short_code
,
getLikes
.
profile
)
getLikes
.
password
,
getLikes
.
post_short_code
,
getLikes
.
profile
)
}
}
@
Post
(
'
get-comments
'
)
@
Post
(
'
get-comments
'
)
async
getComments
(@
Body
()
getComments
:
GetCommentsDto
)
{
async
getComments
(@
Body
()
getComments
:
GetCommentsDto
)
{
return
await
this
.
instagramService
.
getCommentsFromInstaLoader
(
getComments
.
username
,
return
await
this
.
instagramService
.
getCommentsFromInstaLoader
(
getComments
.
username
,
getComments
.
password
,
getComments
.
post_short_code
,
getComments
.
profile
getComments
.
password
,
getComments
.
post_short_code
,
getComments
.
profile
)
)
}
}
}
}
src/instagram/instagram.module.ts
View file @
c22fd7fd
import
{
Module
}
from
'
@nestjs/common
'
;
import
{
Module
}
from
'
@nestjs/common
'
;
import
{
MongooseModule
}
from
'
@nestjs/mongoose
'
;
import
{
MongooseModule
}
from
'
@nestjs/mongoose
'
;
import
{
InstagramController
}
from
'
./instagram.controller
'
;
import
{
InstagramController
}
from
'
./instagram.controller
'
;
import
{
InstagramService
}
from
'
./instagram.service
'
;
import
{
InstagramService
}
from
'
./instagram.service
'
;
import
{
CommentSchema
}
from
'
./models/comment.schema
'
;
import
{
CommentSchema
}
from
'
./models/comment.schema
'
;
import
{
FollowerSchema
}
from
'
./models/follower.schema
'
;
import
{
FollowerSchema
}
from
'
./models/follower.schema
'
;
import
{
LikeSchema
}
from
'
./models/like.schema
'
;
import
{
LikeSchema
}
from
'
./models/like.schema
'
;
import
{
LottoryResultSchema
}
from
'
./models/LottoryResult.schema
'
;
import
{
LottoryResultSchema
}
from
'
./models/LottoryResult.schema
'
;
import
{
UserSchema
}
from
'
./models/user.schema
'
;
import
{
UserSchema
}
from
'
./models/user.schema
'
;
@
Module
({
@
Module
({
imports
:
[
imports
:
[
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
User
'
,
schema
:
UserSchema
},
{
name
:
'
User
'
,
schema
:
UserSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
Follower
'
,
schema
:
FollowerSchema
},
{
name
:
'
Follower
'
,
schema
:
FollowerSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
Like
'
,
schema
:
LikeSchema
},
{
name
:
'
Like
'
,
schema
:
LikeSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
Comment
'
,
schema
:
CommentSchema
},
{
name
:
'
Comment
'
,
schema
:
CommentSchema
},
]),
]),
MongooseModule
.
forFeature
([
MongooseModule
.
forFeature
([
{
name
:
'
LottryResult
'
,
schema
:
LottoryResultSchema
},
{
name
:
'
LottryResult
'
,
schema
:
LottoryResultSchema
},
]),
]),
],
],
controllers
:
[
InstagramController
],
controllers
:
[
InstagramController
],
providers
:
[
InstagramService
]
providers
:
[
InstagramService
]
})
})
export
class
InstagramModule
{
}
export
class
InstagramModule
{
}
src/instagram/instagram.service.ts
View file @
c22fd7fd
import
{
import
{
HttpException
,
HttpException
,
Injectable
,
Injectable
,
OnApplicationBootstrap
,
OnApplicationBootstrap
,
}
from
'
@nestjs/common
'
;
}
from
'
@nestjs/common
'
;
import
{
InjectModel
}
from
'
@nestjs/mongoose
'
;
import
{
InjectModel
}
from
'
@nestjs/mongoose
'
;
import
{
Model
,
Types
}
from
'
mongoose
'
;
import
{
Model
,
Types
}
from
'
mongoose
'
;
import
*
as
_
from
'
lodash
'
;
import
*
as
_
from
'
lodash
'
;
import
{
CommentDocument
}
from
'
./models/comment.schema
'
;
import
{
CommentDocument
}
from
'
./models/comment.schema
'
;
import
{
FollowerDocument
}
from
'
./models/follower.schema
'
;
import
{
FollowerDocument
}
from
'
./models/follower.schema
'
;
import
{
LikeDocument
}
from
'
./models/like.schema
'
;
import
{
LikeDocument
}
from
'
./models/like.schema
'
;
import
{
UserDocument
}
from
'
./models/user.schema
'
;
import
{
UserDocument
}
from
'
./models/user.schema
'
;
import
FollowrData
from
'
./values/followers _data
'
import
FollowrData
from
'
./values/followers _data
'
import
{
spawn
}
from
'
child_process
'
import
{
spawn
}
from
'
child_process
'
import
*
as
path
from
"
path
"
import
*
as
path
from
"
path
"
@
Injectable
()
@
Injectable
()
export
class
InstagramService
implements
OnApplicationBootstrap
{
export
class
InstagramService
implements
OnApplicationBootstrap
{
constructor
(
constructor
(
@
InjectModel
(
'
User
'
)
@
InjectModel
(
'
User
'
)
private
userModel
:
Model
<
UserDocument
>
,
private
userModel
:
Model
<
UserDocument
>
,
@
InjectModel
(
'
Follower
'
)
@
InjectModel
(
'
Follower
'
)
private
followerModel
:
Model
<
FollowerDocument
>
,
private
followerModel
:
Model
<
FollowerDocument
>
,
@
InjectModel
(
'
Like
'
)
@
InjectModel
(
'
Like
'
)
private
likeModel
:
Model
<
LikeDocument
>
,
private
likeModel
:
Model
<
LikeDocument
>
,
@
InjectModel
(
'
Comment
'
)
@
InjectModel
(
'
Comment
'
)
private
commentModel
:
Model
<
CommentDocument
>
,
private
commentModel
:
Model
<
CommentDocument
>
,
)
{
}
)
{
}
async
onApplicationBootstrap
()
{
async
onApplicationBootstrap
()
{
}
}
async
getFollowersFromJsonData
()
{
async
getFollowersFromJsonData
()
{
console
.
log
(
'
start proccess...
'
);
console
.
log
(
'
start proccess...
'
);
let
accountUsername
=
FollowrData
.
account_username
let
accountUsername
=
FollowrData
.
account_username
let
account
=
await
this
.
findOrCreateUser
(
accountUsername
)
let
account
=
await
this
.
findOrCreateUser
(
accountUsername
)
for
await
(
const
follower
of
FollowrData
.
relationships_followers
)
{
for
await
(
const
follower
of
FollowrData
.
relationships_followers
)
{
let
user
=
await
this
.
findOrCreateUser
(
follower
.
string_list_data
[
0
].
value
.
toString
())
let
user
=
await
this
.
findOrCreateUser
(
follower
.
string_list_data
[
0
].
value
.
toString
())
let
foundFollower
=
await
this
.
followerModel
.
findOne
({
$and
:
[{
user_id
:
user
.
_id
},
{
account_id
:
account
.
_id
}]
})
let
foundFollower
=
await
this
.
followerModel
.
findOne
({
$and
:
[{
user_id
:
user
.
_id
},
{
account_id
:
account
.
_id
}]
})
if
(
!
foundFollower
)
{
if
(
!
foundFollower
)
{
let
importedFollower
=
await
this
.
followerModel
.
create
({
let
importedFollower
=
await
this
.
followerModel
.
create
({
_id
:
Types
.
ObjectId
(),
_id
:
Types
.
ObjectId
(),
user_id
:
user
.
_id
,
user_id
:
user
.
_id
,
account_id
:
account
.
_id
,
account_id
:
account
.
_id
,
follow_date
:
follower
.
string_list_data
[
0
].
timestamp
follow_date
:
follower
.
string_list_data
[
0
].
timestamp
})
})
}
}
}
}
console
.
log
(
'
end of proccess...
'
)
console
.
log
(
'
end of proccess...
'
)
return
{
message
:
"
successfull
"
}
return
{
message
:
"
successfull
"
}
}
}
async
getLikesFromInstaLoader
(
username
:
string
,
password
:
string
,
post_short_code
:
string
,
profile
:
string
)
{
async
getLikesFromInstaLoader
(
username
:
string
,
password
:
string
,
post_short_code
:
string
,
profile
:
string
)
{
let
paths
=
path
.
resolve
(
"
src
"
,
"
instagram
"
,
"
instaloader-service
"
,
"
getLikes.py
"
)
let
paths
=
path
.
resolve
(
"
src
"
,
"
instagram
"
,
"
instaloader-service
"
,
"
getLikes.py
"
)
const
getLikesProccess
=
spawn
(
'
python3
'
,
[
`
${
paths
}
`
,
`
${
username
}
`
,
`
${
password
}
`
,
`
${
post_short_code
}
`
,
`
${
profile
}
`
,]);
const
getLikesProccess
=
spawn
(
'
python3
'
,
[
`
${
paths
}
`
,
`
${
username
}
`
,
`
${
password
}
`
,
`
${
post_short_code
}
`
,
`
${
profile
}
`
,]);
getLikesProccess
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
getLikesProccess
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
console
.
log
(
'
start collecting likes from python script ...
'
);
console
.
log
(
'
start collecting likes from python script ...
'
);
console
.
log
(
data
.
toString
())
console
.
log
(
data
.
toString
())
});
});
getLikesProccess
.
on
(
'
error
'
,
(
err
)
=>
{
getLikesProccess
.
on
(
'
error
'
,
(
err
)
=>
{
console
.
log
(
`child process has error
${
err
}
`
)
console
.
log
(
`child process has error
${
err
}
`
)
});
});
getLikesProccess
.
on
(
'
close
'
,
(
code
)
=>
{
getLikesProccess
.
on
(
'
close
'
,
(
code
)
=>
{
console
.
log
(
`child process close all stdio with code
${
code
}
`
);
console
.
log
(
`child process close all stdio with code
${
code
}
`
);
});
});
}
}
async
getCommentsFromInstaLoader
(
username
:
string
,
password
:
string
,
post_short_code
:
string
,
profile
:
string
)
{
async
getCommentsFromInstaLoader
(
username
:
string
,
password
:
string
,
post_short_code
:
string
,
profile
:
string
)
{
let
paths
=
path
.
resolve
(
"
src
"
,
"
instagram
"
,
"
instaloader-service
"
,
"
getComments.py
"
)
let
paths
=
path
.
resolve
(
"
src
"
,
"
instagram
"
,
"
instaloader-service
"
,
"
getComments.py
"
)
const
getCommentsProccess
=
spawn
(
'
python3
'
,
[
`'
${
paths
}
`
,
`
${
username
}
`
,
`
${
password
}
`
,
`
${
post_short_code
}
`
,
`
${
profile
}
`
]);
const
getCommentsProccess
=
spawn
(
'
python3
'
,
[
`'
${
paths
}
`
,
`
${
username
}
`
,
`
${
password
}
`
,
`
${
post_short_code
}
`
,
`
${
profile
}
`
]);
getCommentsProccess
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
getCommentsProccess
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
console
.
log
(
'
start collecting comments from python script ...
'
);
console
.
log
(
'
start collecting comments from python script ...
'
);
console
.
log
(
data
.
toString
())
console
.
log
(
data
.
toString
())
});
});
getCommentsProccess
.
on
(
'
error
'
,
(
err
)
=>
{
getCommentsProccess
.
on
(
'
error
'
,
(
err
)
=>
{
console
.
log
(
`child process has error
${
err
}
`
);
console
.
log
(
`child process has error
${
err
}
`
);
});
});
getCommentsProccess
.
on
(
'
close
'
,
(
code
)
=>
{
getCommentsProccess
.
on
(
'
close
'
,
(
code
)
=>
{
console
.
log
(
`child process close all stdio with code
${
code
}
`
);
console
.
log
(
`child process close all stdio with code
${
code
}
`
);
});
});
}
}
async
getFollowersFromInstaLoader
(
username
:
string
,
password
:
string
,
profile
:
string
)
{
async
getFollowersFromInstaLoader
(
username
:
string
,
password
:
string
,
profile
:
string
)
{
let
paths
=
path
.
resolve
(
"
src
"
,
"
instagram
"
,
"
instaloader-service
"
,
"
getFollowers.py
"
)
let
paths
=
path
.
resolve
(
"
src
"
,
"
instagram
"
,
"
instaloader-service
"
,
"
getFollowers.py
"
)
const
getFollowersProccess
=
spawn
(
'
python3
'
,
[
`
${
paths
}
`
,
`
${
username
}
`
,
`
${
password
}
`
,
`
${
profile
}
`
]);
const
getFollowersProccess
=
spawn
(
'
python3
'
,
[
`
${
paths
}
`
,
`
${
username
}
`
,
`
${
password
}
`
,
`
${
profile
}
`
]);
getFollowersProccess
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
getFollowersProccess
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
console
.
log
(
'
start collecting followers from python script ...
'
);
console
.
log
(
'
start collecting followers from python script ...
'
);
console
.
log
(
data
.
toString
())
console
.
log
(
data
.
toString
())
});
});
getFollowersProccess
.
on
(
'
error
'
,
(
err
)
=>
{
getFollowersProccess
.
on
(
'
error
'
,
(
err
)
=>
{
console
.
log
(
`child process has error
${
err
}
`
);
console
.
log
(
`child process has error
${
err
}
`
);
});
});
getFollowersProccess
.
on
(
'
close
'
,
(
code
)
=>
{
getFollowersProccess
.
on
(
'
close
'
,
(
code
)
=>
{
console
.
log
(
`child process close all stdio with code
${
code
}
`
);
console
.
log
(
`child process close all stdio with code
${
code
}
`
);
});
});
}
}
async
findOrCreateUser
(
username
:
string
)
{
async
findOrCreateUser
(
username
:
string
)
{
let
user
:
UserDocument
let
user
:
UserDocument
let
foundUser
=
await
this
.
userModel
.
findOne
({
username
})
let
foundUser
=
await
this
.
userModel
.
findOne
({
username
})
if
(
!
foundUser
)
{
if
(
!
foundUser
)
{
let
createdUser
=
await
this
.
userModel
.
create
({
let
createdUser
=
await
this
.
userModel
.
create
({
_id
:
Types
.
ObjectId
(),
_id
:
Types
.
ObjectId
(),
username
:
username
username
:
username
})
})
user
=
createdUser
user
=
createdUser
}
}
else
{
else
{
user
=
foundUser
user
=
foundUser
}
}
return
user
return
user
}
}
}
}
src/instagram/instaloader-service/get-Instagram-data.service.py
View file @
c22fd7fd
import
instaloader
import
instaloader
import
pymongo
import
pymongo
username
=
"kakasrm"
username
=
"kakasrm"
password
=
"kaka1374"
password
=
"kaka1374"
mongo_connection_string
=
"mongodb://azadi:azadi%404010@185.231.180.248:27017/?serverSelectionTimeoutMS=5000&connectTimeoutMS=10000&authSource=admin&authMechanism=SCRAM-SHA-256"
mongo_connection_string
=
"mongodb://azadi:azadi%404010@185.231.180.248:27017/?serverSelectionTimeoutMS=5000&connectTimeoutMS=10000&authSource=admin&authMechanism=SCRAM-SHA-256"
database_name
=
"azadi-gold-backend"
database_name
=
"azadi-gold-backend"
post_short_code
=
"CSCUev0swJO"
post_short_code
=
"CSCUev0swJO"
PROFILE
=
"azadi.gold"
PROFILE
=
"azadi.gold"
def
__main__
():
def
__main__
():
print
(
"connecting to the instagram ...."
)
print
(
"connecting to the instagram ...."
)
L
=
instaloader
.
Instaloader
()
L
=
instaloader
.
Instaloader
()
L
.
login
(
username
,
password
)
L
.
login
(
username
,
password
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
print
(
"connected to the instagram :) "
)
print
(
"connected to the instagram :) "
)
print
(
"Load post data ...."
)
print
(
"Load post data ...."
)
post
=
instaloader
.
Post
.
from_shortcode
(
L
.
context
,
post_short_code
)
post
=
instaloader
.
Post
.
from_shortcode
(
L
.
context
,
post_short_code
)
print
(
"Post data loaded :) "
)
print
(
"Post data loaded :) "
)
print
(
"connecting to the database ...."
)
print
(
"connecting to the database ...."
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
db
=
client
[
database_name
]
db
=
client
[
database_name
]
# get likes of given post short code
# get likes of given post short code
getLikes
(
db
,
post
,
PROFILE
)
getLikes
(
db
,
post
,
PROFILE
)
# get comments of given post short code
# get comments of given post short code
# getComments(db, post, PROFILE)
# getComments(db, post, PROFILE)
# get Followers of given profile
# get Followers of given profile
# getFollowers(db, profile, PROFILE)
# getFollowers(db, profile, PROFILE)
# get tagged Posts of given profile
# get tagged Posts of given profile
# getTaggedPosts(db, profile)
# getTaggedPosts(db, profile)
def
getComments
(
db
,
post
,
profile
):
def
getComments
(
db
,
post
,
profile
):
col
=
db
[
"comments"
]
col
=
db
[
"comments"
]
post_col
=
db
[
"posts"
]
post_col
=
db
[
"posts"
]
account_col
=
db
[
'users'
]
account_col
=
db
[
'users'
]
print
(
'start getting comments'
)
print
(
'start getting comments'
)
account_id
=
None
account_id
=
None
post_id
=
None
post_id
=
None
found_account
=
account_col
.
find_one
({
"username"
:
profile
},
)
found_account
=
account_col
.
find_one
({
"username"
:
profile
},
)
if
found_account
is
not
None
:
if
found_account
is
not
None
:
print
(
found_account
[
'username'
],
'is already exists'
)
print
(
found_account
[
'username'
],
'is already exists'
)
account_id
=
found_account
[
'_id'
]
account_id
=
found_account
[
'_id'
]
else
:
else
:
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
account_id
=
created_account
.
inserted_id
account_id
=
created_account
.
inserted_id
print
(
profile
,
'added to users'
)
print
(
profile
,
'added to users'
)
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
if
found_post
is
not
None
:
if
found_post
is
not
None
:
print
(
found_post
[
'url'
],
'is already exists'
)
print
(
found_post
[
'url'
],
'is already exists'
)
post_id
=
found_post
[
'_id'
]
post_id
=
found_post
[
'_id'
]
else
:
else
:
created_post
=
post_col
.
insert_one
({
"url"
:
post_short_code
,
"user_id"
:
account_id
})
created_post
=
post_col
.
insert_one
({
"url"
:
post_short_code
,
"user_id"
:
account_id
})
post_id
=
created_post
.
inserted_id
post_id
=
created_post
.
inserted_id
print
(
post_short_code
,
'added to posts'
)
print
(
post_short_code
,
'added to posts'
)
for
comment
in
post
.
get_comments
():
for
comment
in
post
.
get_comments
():
print
(
"Searching : "
,
comment
.
id
)
print
(
"Searching : "
,
comment
.
id
)
search
=
col
.
find_one
({
"comment_id"
:
comment
.
id
})
search
=
col
.
find_one
({
"comment_id"
:
comment
.
id
})
try
:
try
:
if
search
is
not
None
and
search
[
"comment_id"
]:
if
search
is
not
None
and
search
[
"comment_id"
]:
print
(
comment
.
id
,
" Already Exist"
)
print
(
comment
.
id
,
" Already Exist"
)
else
:
else
:
user_id
=
None
user_id
=
None
found_username
=
account_col
.
find_one
({
'username'
:
comment
.
owner
.
username
})
found_username
=
account_col
.
find_one
({
'username'
:
comment
.
owner
.
username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
user_id
=
found_username
[
'_id'
]
user_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
({
"username"
:
comment
.
owner
.
username
,
created_user
=
account_col
.
insert_one
({
"username"
:
comment
.
owner
.
username
,
"instagram_user_id"
:
comment
.
owner
.
userid
})
"instagram_user_id"
:
comment
.
owner
.
userid
})
user_id
=
created_user
.
inserted_id
user_id
=
created_user
.
inserted_id
print
(
comment
.
owner
.
username
,
'added to users'
)
print
(
comment
.
owner
.
username
,
'added to users'
)
temp
=
{
"comment_id"
:
comment
.
id
,
"user_id"
:
user_id
,
"post_id"
:
post_id
,
temp
=
{
"comment_id"
:
comment
.
id
,
"user_id"
:
user_id
,
"post_id"
:
post_id
,
"text"
:
comment
.
text
,
"date"
:
comment
.
created_at_utc
.
timestamp
()}
"text"
:
comment
.
text
,
"date"
:
comment
.
created_at_utc
.
timestamp
()}
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
print
(
comment
.
id
,
" added"
)
print
(
comment
.
id
,
" added"
)
except
:
except
:
print
(
"Error"
)
print
(
"Error"
)
def
getLikes
(
db
,
post
,
profile
):
def
getLikes
(
db
,
post
,
profile
):
col
=
db
[
"likes"
]
col
=
db
[
"likes"
]
post_col
=
db
[
"posts"
]
post_col
=
db
[
"posts"
]
account_col
=
db
[
'users'
]
account_col
=
db
[
'users'
]
print
(
'start getting likes'
)
print
(
'start getting likes'
)
account_id
=
None
account_id
=
None
post_id
=
None
post_id
=
None
found_account
=
account_col
.
find_one
({
"username"
:
profile
},)
found_account
=
account_col
.
find_one
({
"username"
:
profile
},)
if
found_account
is
not
None
:
if
found_account
is
not
None
:
print
(
found_account
[
'username'
],
'is already exists'
)
print
(
found_account
[
'username'
],
'is already exists'
)
account_id
=
found_account
[
'_id'
]
account_id
=
found_account
[
'_id'
]
else
:
else
:
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
account_id
=
created_account
.
inserted_id
account_id
=
created_account
.
inserted_id
print
(
profile
,
'added to users'
)
print
(
profile
,
'added to users'
)
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
if
found_post
is
not
None
:
if
found_post
is
not
None
:
print
(
found_post
[
'url'
],
'is already exists'
)
print
(
found_post
[
'url'
],
'is already exists'
)
post_id
=
found_post
[
'_id'
]
post_id
=
found_post
[
'_id'
]
else
:
else
:
created_post
=
post_col
.
insert_one
({
"url"
:
post_short_code
,
"user_id"
:
account_id
})
created_post
=
post_col
.
insert_one
({
"url"
:
post_short_code
,
"user_id"
:
account_id
})
post_id
=
created_post
.
inserted_id
post_id
=
created_post
.
inserted_id
print
(
post_short_code
,
'added to posts'
)
print
(
post_short_code
,
'added to posts'
)
for
like
in
post
.
get_likes
():
for
like
in
post
.
get_likes
():
print
(
'======'
,
like
)
print
(
'======'
,
like
)
print
(
"Searching : "
,
like
.
username
,
post_id
)
print
(
"Searching : "
,
like
.
username
,
post_id
)
search
=
col
.
find_one
(
search
=
col
.
find_one
(
{
"username"
:
like
.
username
,
"post_id"
:
post_id
})
{
"username"
:
like
.
username
,
"post_id"
:
post_id
})
try
:
try
:
if
search
is
not
None
:
if
search
is
not
None
:
print
(
like
.
username
,
" Already like post : "
,
post_id
)
print
(
like
.
username
,
" Already like post : "
,
post_id
)
else
:
else
:
user_id
=
None
user_id
=
None
found_username
=
account_col
.
find_one
({
'username'
:
like
.
username
})
found_username
=
account_col
.
find_one
({
'username'
:
like
.
username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
user_id
=
found_username
[
'_id'
]
user_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
(
created_user
=
account_col
.
insert_one
(
{
"username"
:
like
.
username
})
{
"username"
:
like
.
username
})
user_id
=
created_user
.
inserted_id
user_id
=
created_user
.
inserted_id
print
(
like
.
username
,
'added to users'
)
print
(
like
.
username
,
'added to users'
)
temp
=
{
"user_id"
:
user_id
,
temp
=
{
"user_id"
:
user_id
,
"post_id"
:
post_id
}
"post_id"
:
post_id
}
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
print
(
like
.
username
,
" like post : "
,
post_short_code
)
print
(
like
.
username
,
" like post : "
,
post_short_code
)
except
:
except
:
print
(
"Error"
)
print
(
"Error"
)
def
getFollowers
(
db
,
profile
,
profile_username
):
def
getFollowers
(
db
,
profile
,
profile_username
):
col
=
db
[
"followers"
]
col
=
db
[
"followers"
]
account_col
=
db
[
'users'
]
account_col
=
db
[
'users'
]
account_id
=
None
account_id
=
None
found_username
=
account_col
.
find_one
({
'username'
:
profile_username
})
found_username
=
account_col
.
find_one
({
'username'
:
profile_username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
account_id
=
found_username
[
'_id'
]
account_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
(
created_user
=
account_col
.
insert_one
(
{
"username"
:
profile_username
,
type
:
"business"
})
{
"username"
:
profile_username
,
type
:
"business"
})
account_id
=
created_user
.
inserted_id
account_id
=
created_user
.
inserted_id
print
(
profile_username
,
'added to users'
)
print
(
profile_username
,
'added to users'
)
for
follower
in
profile
.
get_followers
():
for
follower
in
profile
.
get_followers
():
print
(
"Searching in "
,
profile
,
" for :"
,
follower
.
username
)
print
(
"Searching in "
,
profile
,
" for :"
,
follower
.
username
)
search
=
col
.
find_one
({
"username"
:
follower
.
username
})
search
=
col
.
find_one
({
"username"
:
follower
.
username
})
try
:
try
:
if
search
is
not
None
:
if
search
is
not
None
:
print
(
follower
.
username
,
" Already Exist in : "
,
print
(
follower
.
username
,
" Already Exist in : "
,
profile
,
"Followers"
)
profile
,
"Followers"
)
else
:
else
:
user_id
=
None
user_id
=
None
found_username
=
account_col
.
find_one
({
'username'
:
follower
.
username
})
found_username
=
account_col
.
find_one
({
'username'
:
follower
.
username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
user_id
=
found_username
[
'_id'
]
user_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
(
created_user
=
account_col
.
insert_one
(
{
"username"
:
follower
.
username
,
{
"username"
:
follower
.
username
,
"instagram_user_id"
:
follower
.
userid
,
"full_name"
:
follower
.
full_name
})
"instagram_user_id"
:
follower
.
userid
,
"full_name"
:
follower
.
full_name
})
user_id
=
created_user
.
inserted_id
user_id
=
created_user
.
inserted_id
print
(
follower
.
username
,
'added to users'
)
print
(
follower
.
username
,
'added to users'
)
temp
=
{
"username"
:
follower
.
username
,
"user_id"
:
user_id
,
temp
=
{
"username"
:
follower
.
username
,
"user_id"
:
user_id
,
"account_id"
:
account_id
,
"follow_date"
:
""
,
"profile_pic"
:
follower
.
profile_pic_url
,
}
"account_id"
:
account_id
,
"follow_date"
:
""
,
"profile_pic"
:
follower
.
profile_pic_url
,
}
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
print
(
follower
.
username
,
" followed : "
,
profile
)
print
(
follower
.
username
,
" followed : "
,
profile
)
except
:
except
:
print
(
"Error"
)
print
(
"Error"
)
def
getTaggedPosts
(
db
,
profile
):
def
getTaggedPosts
(
db
,
profile
):
col
=
db
[
"tagged"
]
col
=
db
[
"tagged"
]
for
tagged_post
in
profile
.
get_tagged_posts
():
for
tagged_post
in
profile
.
get_tagged_posts
():
print
(
"Searching in "
,
profile
,
print
(
"Searching in "
,
profile
,
" for tagged post with id :"
,
tagged_post
.
shortcode
)
" for tagged post with id :"
,
tagged_post
.
shortcode
)
search
=
col
.
find_one
({
"short_code"
:
tagged_post
.
shortcode
})
search
=
col
.
find_one
({
"short_code"
:
tagged_post
.
shortcode
})
try
:
try
:
if
search
is
not
None
:
if
search
is
not
None
:
print
(
tagged_post
.
shortcode
,
" Already Exist in : tagged_posts"
)
print
(
tagged_post
.
shortcode
,
" Already Exist in : tagged_posts"
)
else
:
else
:
temp
=
{
"username"
:
tagged_post
.
username
,
"user_id"
:
tagged_post
.
userid
,
temp
=
{
"username"
:
tagged_post
.
username
,
"user_id"
:
tagged_post
.
userid
,
"post_short_code"
:
tagged_post
.
shortcode
,
"post_short_code"
:
tagged_post
.
shortcode
,
"business_username"
:
PROFILE
,
"post_date"
:
tagged_post
.
date_utc
}
"business_username"
:
PROFILE
,
"post_date"
:
tagged_post
.
date_utc
}
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
print
(
tagged_post
.
shortcode
,
" added"
)
print
(
tagged_post
.
shortcode
,
" added"
)
except
:
except
:
print
(
"Error"
)
print
(
"Error"
)
__main__
()
__main__
()
src/instagram/instaloader-service/getComments.py
View file @
c22fd7fd
import
instaloader
import
instaloader
import
pymongo
import
pymongo
import
sys
import
sys
username
=
"kakasrm"
username
=
"kakasrm"
password
=
"kaka1374"
password
=
"kaka1374"
mongo_connection_string
=
"mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256"
mongo_connection_string
=
"mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256"
database_name
=
"instagram-lottry"
database_name
=
"instagram-lottry"
post_short_code
=
"CShKEJijy4v"
post_short_code
=
"CShKEJijy4v"
PROFILE
=
"azadi.gold"
PROFILE
=
"azadi.gold"
def
__main__
():
def
__main__
():
print
(
"connecting to the instagram ...."
)
print
(
"connecting to the instagram ...."
)
L
=
instaloader
.
Instaloader
()
L
=
instaloader
.
Instaloader
()
L
.
login
(
username
,
password
)
L
.
login
(
username
,
password
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
print
(
"connected to the instagram :) "
)
print
(
"connected to the instagram :) "
)
print
(
"Load post data ...."
)
print
(
"Load post data ...."
)
post
=
instaloader
.
Post
.
from_shortcode
(
L
.
context
,
post_short_code
)
post
=
instaloader
.
Post
.
from_shortcode
(
L
.
context
,
post_short_code
)
print
(
"Post data loaded :) "
)
print
(
"Post data loaded :) "
)
print
(
"connecting to the database ...."
)
print
(
"connecting to the database ...."
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
db
=
client
[
database_name
]
db
=
client
[
database_name
]
# get comments of given post short code
# get comments of given post short code
getComments
(
db
,
post
,
PROFILE
)
getComments
(
db
,
post
,
PROFILE
)
def
getComments
(
db
,
post
,
profile
):
def
getComments
(
db
,
post
,
profile
):
col
=
db
[
"comments"
]
col
=
db
[
"comments"
]
post_col
=
db
[
"posts"
]
post_col
=
db
[
"posts"
]
account_col
=
db
[
'users'
]
account_col
=
db
[
'users'
]
print
(
'start getting comments'
)
print
(
'start getting comments'
)
account_id
=
None
account_id
=
None
post_id
=
None
post_id
=
None
found_account
=
account_col
.
find_one
({
"username"
:
profile
},
)
found_account
=
account_col
.
find_one
({
"username"
:
profile
},
)
if
found_account
is
not
None
:
if
found_account
is
not
None
:
print
(
found_account
[
'username'
],
'is already exists'
)
print
(
found_account
[
'username'
],
'is already exists'
)
account_id
=
found_account
[
'_id'
]
account_id
=
found_account
[
'_id'
]
else
:
else
:
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
account_id
=
created_account
.
inserted_id
account_id
=
created_account
.
inserted_id
print
(
profile
,
'added to users'
)
print
(
profile
,
'added to users'
)
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
if
found_post
is
not
None
:
if
found_post
is
not
None
:
print
(
found_post
[
'url'
],
'is already exists'
)
print
(
found_post
[
'url'
],
'is already exists'
)
post_id
=
found_post
[
'_id'
]
post_id
=
found_post
[
'_id'
]
else
:
else
:
created_post
=
post_col
.
insert_one
(
created_post
=
post_col
.
insert_one
(
{
"url"
:
post_short_code
,
"user_id"
:
account_id
})
{
"url"
:
post_short_code
,
"user_id"
:
account_id
})
post_id
=
created_post
.
inserted_id
post_id
=
created_post
.
inserted_id
print
(
post_short_code
,
'added to posts'
)
print
(
post_short_code
,
'added to posts'
)
for
comment
in
post
.
get_comments
():
for
comment
in
post
.
get_comments
():
print
(
"Searching : "
,
comment
.
id
)
print
(
"Searching : "
,
comment
.
id
)
search
=
col
.
find_one
({
"comment_id"
:
comment
.
id
})
search
=
col
.
find_one
({
"comment_id"
:
comment
.
id
})
try
:
try
:
if
search
is
not
None
and
search
[
"comment_id"
]:
if
search
is
not
None
and
search
[
"comment_id"
]:
print
(
comment
.
id
,
" Already Exist"
)
print
(
comment
.
id
,
" Already Exist"
)
else
:
else
:
user_id
=
None
user_id
=
None
found_username
=
account_col
.
find_one
(
found_username
=
account_col
.
find_one
(
{
'username'
:
comment
.
owner
.
username
})
{
'username'
:
comment
.
owner
.
username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
user_id
=
found_username
[
'_id'
]
user_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
({
"username"
:
comment
.
owner
.
username
,
created_user
=
account_col
.
insert_one
({
"username"
:
comment
.
owner
.
username
,
"instagram_user_id"
:
comment
.
owner
.
userid
})
"instagram_user_id"
:
comment
.
owner
.
userid
})
user_id
=
created_user
.
inserted_id
user_id
=
created_user
.
inserted_id
print
(
comment
.
owner
.
username
,
'added to users'
)
print
(
comment
.
owner
.
username
,
'added to users'
)
temp
=
{
"comment_id"
:
comment
.
id
,
"user_id"
:
user_id
,
"post_id"
:
post_id
,
temp
=
{
"comment_id"
:
comment
.
id
,
"user_id"
:
user_id
,
"post_id"
:
post_id
,
"text"
:
comment
.
text
,
"date"
:
comment
.
created_at_utc
.
timestamp
()}
"text"
:
comment
.
text
,
"date"
:
comment
.
created_at_utc
.
timestamp
()}
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
print
(
comment
.
id
,
" added"
)
print
(
comment
.
id
,
" added"
)
except
:
except
:
print
(
"Error"
)
print
(
"Error"
)
__main__
()
__main__
()
src/instagram/instaloader-service/getFollowers.py
View file @
c22fd7fd
import
instaloader
import
instaloader
import
pymongo
import
pymongo
import
sys
import
sys
username
=
str
(
sys
.
argv
[
1
])
username
=
str
(
sys
.
argv
[
1
])
password
=
str
(
sys
.
argv
[
2
])
password
=
str
(
sys
.
argv
[
2
])
mongo_connection_string
=
"mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256"
mongo_connection_string
=
"mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256"
database_name
=
"instagram-lottry"
database_name
=
"instagram-lottry"
PROFILE
=
str
(
sys
.
argv
[
3
])
PROFILE
=
str
(
sys
.
argv
[
3
])
def
__main__
():
def
__main__
():
print
(
"connecting to the instagram ...."
)
print
(
"connecting to the instagram ...."
)
L
=
instaloader
.
Instaloader
()
L
=
instaloader
.
Instaloader
()
L
.
login
(
username
,
password
)
L
.
login
(
username
,
password
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
print
(
"connected to the instagram :) "
)
print
(
"connected to the instagram :) "
)
print
(
"Load post data ...."
)
print
(
"Load post data ...."
)
# post = instaloader.Post.from_shortcode(L.context, post_short_code)
# post = instaloader.Post.from_shortcode(L.context, post_short_code)
print
(
"Post data loaded :) "
)
print
(
"Post data loaded :) "
)
print
(
"connecting to the database ...."
)
print
(
"connecting to the database ...."
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
db
=
client
[
database_name
]
db
=
client
[
database_name
]
# get Followers of given profile
# get Followers of given profile
getFollowers
(
db
,
profile
,
PROFILE
)
getFollowers
(
db
,
profile
,
PROFILE
)
def
getFollowers
(
db
,
profile
,
profile_username
):
def
getFollowers
(
db
,
profile
,
profile_username
):
col
=
db
[
"followers"
]
col
=
db
[
"followers"
]
account_col
=
db
[
'users'
]
account_col
=
db
[
'users'
]
account_id
=
None
account_id
=
None
found_username
=
account_col
.
find_one
({
'username'
:
profile_username
})
found_username
=
account_col
.
find_one
({
'username'
:
profile_username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
account_id
=
found_username
[
'_id'
]
account_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
(
created_user
=
account_col
.
insert_one
(
{
"username"
:
profile_username
,
type
:
"business"
})
{
"username"
:
profile_username
,
type
:
"business"
})
account_id
=
created_user
.
inserted_id
account_id
=
created_user
.
inserted_id
print
(
profile_username
,
'added to users'
)
print
(
profile_username
,
'added to users'
)
for
follower
in
profile
.
get_followers
():
for
follower
in
profile
.
get_followers
():
print
(
"Searching in "
,
profile
,
" for :"
,
follower
.
username
)
print
(
"Searching in "
,
profile
,
" for :"
,
follower
.
username
)
search
=
col
.
find_one
({
"username"
:
follower
.
username
})
search
=
col
.
find_one
({
"username"
:
follower
.
username
})
try
:
try
:
if
search
is
not
None
:
if
search
is
not
None
:
print
(
follower
.
username
,
" Already Exist in : "
,
print
(
follower
.
username
,
" Already Exist in : "
,
profile
,
"Followers"
)
profile
,
"Followers"
)
else
:
else
:
user_id
=
None
user_id
=
None
found_username
=
account_col
.
find_one
(
found_username
=
account_col
.
find_one
(
{
'username'
:
follower
.
username
})
{
'username'
:
follower
.
username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
user_id
=
found_username
[
'_id'
]
user_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
(
created_user
=
account_col
.
insert_one
(
{
"username"
:
follower
.
username
,
{
"username"
:
follower
.
username
,
"instagram_user_id"
:
follower
.
userid
,
"full_name"
:
follower
.
full_name
})
"instagram_user_id"
:
follower
.
userid
,
"full_name"
:
follower
.
full_name
})
user_id
=
created_user
.
inserted_id
user_id
=
created_user
.
inserted_id
print
(
follower
.
username
,
'added to users'
)
print
(
follower
.
username
,
'added to users'
)
temp
=
{
"username"
:
follower
.
username
,
"user_id"
:
user_id
,
temp
=
{
"username"
:
follower
.
username
,
"user_id"
:
user_id
,
"account_id"
:
account_id
,
"follow_date"
:
""
,
"profile_pic"
:
follower
.
profile_pic_url
,
}
"account_id"
:
account_id
,
"follow_date"
:
""
,
"profile_pic"
:
follower
.
profile_pic_url
,
}
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
print
(
follower
.
username
,
" followed : "
,
profile
)
print
(
follower
.
username
,
" followed : "
,
profile
)
except
:
except
:
print
(
"Error"
)
print
(
"Error"
)
__main__
()
__main__
()
src/instagram/instaloader-service/getLikes.py
View file @
c22fd7fd
import
instaloader
import
instaloader
import
pymongo
import
pymongo
import
sys
import
sys
username
=
str
(
sys
.
argv
[
1
])
username
=
str
(
sys
.
argv
[
1
])
password
=
str
(
sys
.
argv
[
2
])
password
=
str
(
sys
.
argv
[
2
])
mongo_connection_string
=
"mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256"
mongo_connection_string
=
"mongodb://instagram:wcD3B5sGw0yQ@185.231.180.248:27017/instagram-lottry?authSource=admin&authMechanism=SCRAM-SHA-256"
database_name
=
"instagram-lottry"
database_name
=
"instagram-lottry"
post_short_code
=
str
(
sys
.
argv
[
3
])
post_short_code
=
str
(
sys
.
argv
[
3
])
PROFILE
=
str
(
sys
.
argv
[
4
])
PROFILE
=
str
(
sys
.
argv
[
4
])
def
__main__
():
def
__main__
():
print
(
sys
.
argv
[
1
],
sys
.
argv
[
2
],
sys
.
argv
[
3
],
sys
.
argv
[
4
])
print
(
sys
.
argv
[
1
],
sys
.
argv
[
2
],
sys
.
argv
[
3
],
sys
.
argv
[
4
])
print
(
"connecting to the instagram ...."
)
print
(
"connecting to the instagram ...."
)
L
=
instaloader
.
Instaloader
()
L
=
instaloader
.
Instaloader
()
L
.
login
(
username
,
password
)
L
.
login
(
username
,
password
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
profile
=
instaloader
.
Profile
.
from_username
(
L
.
context
,
PROFILE
)
print
(
"connected to the instagram :) "
)
print
(
"connected to the instagram :) "
)
print
(
"Load post data ...."
)
print
(
"Load post data ...."
)
post
=
instaloader
.
Post
.
from_shortcode
(
L
.
context
,
post_short_code
)
post
=
instaloader
.
Post
.
from_shortcode
(
L
.
context
,
post_short_code
)
print
(
"Post data loaded :) "
)
print
(
"Post data loaded :) "
)
print
(
"connecting to the database ...."
)
print
(
"connecting to the database ...."
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
client
=
pymongo
.
MongoClient
(
mongo_connection_string
)
db
=
client
[
database_name
]
db
=
client
[
database_name
]
# get likes of given post short code
# get likes of given post short code
getLikes
(
db
,
post
,
PROFILE
)
getLikes
(
db
,
post
,
PROFILE
)
def
getLikes
(
db
,
post
,
profile
):
def
getLikes
(
db
,
post
,
profile
):
col
=
db
[
"likes"
]
col
=
db
[
"likes"
]
post_col
=
db
[
"posts"
]
post_col
=
db
[
"posts"
]
account_col
=
db
[
'users'
]
account_col
=
db
[
'users'
]
print
(
'start getting likes'
)
print
(
'start getting likes'
)
account_id
=
None
account_id
=
None
post_id
=
None
post_id
=
None
found_account
=
account_col
.
find_one
({
"username"
:
profile
},)
found_account
=
account_col
.
find_one
({
"username"
:
profile
},)
if
found_account
is
not
None
:
if
found_account
is
not
None
:
print
(
found_account
[
'username'
],
'is already exists'
)
print
(
found_account
[
'username'
],
'is already exists'
)
account_id
=
found_account
[
'_id'
]
account_id
=
found_account
[
'_id'
]
else
:
else
:
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
created_account
=
account_col
.
insert_one
({
"username"
:
profile
})
account_id
=
created_account
.
inserted_id
account_id
=
created_account
.
inserted_id
print
(
profile
,
'added to users'
)
print
(
profile
,
'added to users'
)
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
found_post
=
post_col
.
find_one
({
"url"
:
post_short_code
})
if
found_post
is
not
None
:
if
found_post
is
not
None
:
print
(
found_post
[
'url'
],
'is already exists'
)
print
(
found_post
[
'url'
],
'is already exists'
)
post_id
=
found_post
[
'_id'
]
post_id
=
found_post
[
'_id'
]
else
:
else
:
created_post
=
post_col
.
insert_one
(
created_post
=
post_col
.
insert_one
(
{
"url"
:
post_short_code
,
"user_id"
:
account_id
})
{
"url"
:
post_short_code
,
"user_id"
:
account_id
})
post_id
=
created_post
.
inserted_id
post_id
=
created_post
.
inserted_id
print
(
post_short_code
,
'added to posts'
)
print
(
post_short_code
,
'added to posts'
)
for
like
in
post
.
get_likes
():
for
like
in
post
.
get_likes
():
print
(
'======'
,
like
)
print
(
'======'
,
like
)
print
(
"Searching : "
,
like
.
username
,
post_id
)
print
(
"Searching : "
,
like
.
username
,
post_id
)
search
=
col
.
find_one
(
search
=
col
.
find_one
(
{
"username"
:
like
.
username
,
"post_id"
:
post_id
})
{
"username"
:
like
.
username
,
"post_id"
:
post_id
})
try
:
try
:
if
search
is
not
None
:
if
search
is
not
None
:
print
(
like
.
username
,
" Already like post : "
,
post_id
)
print
(
like
.
username
,
" Already like post : "
,
post_id
)
else
:
else
:
user_id
=
None
user_id
=
None
found_username
=
account_col
.
find_one
(
found_username
=
account_col
.
find_one
(
{
'username'
:
like
.
username
})
{
'username'
:
like
.
username
})
if
found_username
is
not
None
:
if
found_username
is
not
None
:
print
(
found_username
[
'username'
],
'is already exists'
)
print
(
found_username
[
'username'
],
'is already exists'
)
user_id
=
found_username
[
'_id'
]
user_id
=
found_username
[
'_id'
]
else
:
else
:
created_user
=
account_col
.
insert_one
(
created_user
=
account_col
.
insert_one
(
{
"username"
:
like
.
username
})
{
"username"
:
like
.
username
})
user_id
=
created_user
.
inserted_id
user_id
=
created_user
.
inserted_id
print
(
like
.
username
,
'added to users'
)
print
(
like
.
username
,
'added to users'
)
temp
=
{
"user_id"
:
user_id
,
temp
=
{
"user_id"
:
user_id
,
"post_id"
:
post_id
}
"post_id"
:
post_id
}
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
x
=
col
.
update
(
temp
,
temp
,
upsert
=
True
)
print
(
like
.
username
,
" like post : "
,
post_short_code
)
print
(
like
.
username
,
" like post : "
,
post_short_code
)
except
:
except
:
print
(
"Error"
)
print
(
"Error"
)
__main__
()
__main__
()
src/instagram/models/LottoryResult.schema.ts
View file @
c22fd7fd
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
export
type
LottoryResultDocument
=
LottoryResult
&
Document
;
export
type
LottoryResultDocument
=
LottoryResult
&
Document
;
@
Schema
({
timestamps
:
true
})
@
Schema
({
timestamps
:
true
})
export
class
LottoryResult
{
export
class
LottoryResult
{
@
Prop
()
@
Prop
()
_id
:
Types
.
ObjectId
_id
:
Types
.
ObjectId
@
Prop
()
@
Prop
()
index
:
string
;
index
:
string
;
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
user_id
:
Types
.
ObjectId
user_id
:
Types
.
ObjectId
// @Prop()
// @Prop()
// tagged_user: string;
// tagged_user: string;
@
Prop
()
@
Prop
()
status
:
string
;
status
:
string
;
}
}
export
const
LottoryResultSchema
=
SchemaFactory
.
createForClass
(
LottoryResult
);
export
const
LottoryResultSchema
=
SchemaFactory
.
createForClass
(
LottoryResult
);
src/instagram/models/comment.schema.ts
View file @
c22fd7fd
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
export
type
CommentDocument
=
Comment
&
Document
;
export
type
CommentDocument
=
Comment
&
Document
;
@
Schema
({
timestamps
:
true
})
@
Schema
({
timestamps
:
true
})
export
class
Comment
{
export
class
Comment
{
@
Prop
()
@
Prop
()
_id
:
Types
.
ObjectId
;
_id
:
Types
.
ObjectId
;
@
Prop
()
@
Prop
()
comment_id
:
string
;
comment_id
:
string
;
@
Prop
()
@
Prop
()
text
:
string
;
text
:
string
;
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
user_id
:
Types
.
ObjectId
user_id
:
Types
.
ObjectId
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
Post
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
Post
'
})
post_id
:
Types
.
ObjectId
post_id
:
Types
.
ObjectId
@
Prop
()
@
Prop
()
date
:
number
;
date
:
number
;
@
Prop
({
type
:
Object
})
@
Prop
({
type
:
Object
})
comment_object
:
Object
;
comment_object
:
Object
;
}
}
export
const
CommentSchema
=
SchemaFactory
.
createForClass
(
Comment
);
export
const
CommentSchema
=
SchemaFactory
.
createForClass
(
Comment
);
\ No newline at end of file
src/instagram/models/follower.schema.ts
View file @
c22fd7fd
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
export
type
FollowerDocument
=
Follower
&
Document
;
export
type
FollowerDocument
=
Follower
&
Document
;
@
Schema
({
timestamps
:
true
})
@
Schema
({
timestamps
:
true
})
export
class
Follower
{
export
class
Follower
{
@
Prop
()
@
Prop
()
_id
:
Types
.
ObjectId
;
_id
:
Types
.
ObjectId
;
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
user_id
:
Types
.
ObjectId
user_id
:
Types
.
ObjectId
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
account_id
:
Types
.
ObjectId
account_id
:
Types
.
ObjectId
@
Prop
()
@
Prop
()
follow_date
:
number
;
follow_date
:
number
;
}
}
export
const
FollowerSchema
=
export
const
FollowerSchema
=
SchemaFactory
.
createForClass
(
Follower
);
SchemaFactory
.
createForClass
(
Follower
);
src/instagram/models/like.schema.ts
View file @
c22fd7fd
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
export
type
LikeDocument
=
Like
&
Document
;
export
type
LikeDocument
=
Like
&
Document
;
@
Schema
({
timestamps
:
true
})
@
Schema
({
timestamps
:
true
})
export
class
Like
{
export
class
Like
{
@
Prop
()
@
Prop
()
_id
:
Types
.
ObjectId
;
_id
:
Types
.
ObjectId
;
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
user_id
:
Types
.
ObjectId
user_id
:
Types
.
ObjectId
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
Post
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
Post
'
})
post_id
:
Types
.
ObjectId
post_id
:
Types
.
ObjectId
}
}
export
const
LikeSchema
=
export
const
LikeSchema
=
SchemaFactory
.
createForClass
(
Like
);
SchemaFactory
.
createForClass
(
Like
);
src/instagram/models/post.schema.ts
View file @
c22fd7fd
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
export
type
PostDocument
=
Post
&
Document
;
export
type
PostDocument
=
Post
&
Document
;
@
Schema
({
timestamps
:
true
})
@
Schema
({
timestamps
:
true
})
export
class
Post
{
export
class
Post
{
@
Prop
()
@
Prop
()
_id
:
Types
.
ObjectId
_id
:
Types
.
ObjectId
@
Prop
()
@
Prop
()
url
:
string
url
:
string
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
@
Prop
({
type
:
Types
.
ObjectId
,
ref
:
'
User
'
})
user_id
:
Types
.
ObjectId
user_id
:
Types
.
ObjectId
}
}
export
const
PostSchema
=
export
const
PostSchema
=
SchemaFactory
.
createForClass
(
Post
)
SchemaFactory
.
createForClass
(
Post
)
\ No newline at end of file
src/instagram/models/user.schema.ts
View file @
c22fd7fd
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Prop
,
Schema
,
SchemaFactory
}
from
'
@nestjs/mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
import
{
Document
,
Types
}
from
'
mongoose
'
;
export
type
UserDocument
=
User
&
Document
;
export
type
UserDocument
=
User
&
Document
;
export
enum
AccountType
{
export
enum
AccountType
{
business
=
"
business
"
,
business
=
"
business
"
,
customer
=
"
customer
"
customer
=
"
customer
"
}
}
@
Schema
({
timestamps
:
true
})
@
Schema
({
timestamps
:
true
})
export
class
User
{
export
class
User
{
@
Prop
()
@
Prop
()
_id
:
Types
.
ObjectId
_id
:
Types
.
ObjectId
@
Prop
()
@
Prop
()
username
:
string
username
:
string
@
Prop
()
@
Prop
()
instagram_user_id
:
string
instagram_user_id
:
string
@
Prop
()
@
Prop
()
full_name
:
string
full_name
:
string
@
Prop
({
enum
:
AccountType
})
@
Prop
({
enum
:
AccountType
})
type
:
string
type
:
string
@
Prop
()
@
Prop
()
mobile
:
string
mobile
:
string
}
}
export
const
UserSchema
=
export
const
UserSchema
=
SchemaFactory
.
createForClass
(
User
)
SchemaFactory
.
createForClass
(
User
)
\ No newline at end of file
src/instagram/values/add-to-story-data.ts
View file @
c22fd7fd
export
default
{
export
default
{
addToStoryData
:
[
addToStoryData
:
[
{
{
username
:
"
soma.ye2103
"
,
username
:
"
soma.ye2103
"
,
count
:
5
count
:
5
},
},
{
{
username
:
"
zahra_51512
"
,
username
:
"
zahra_51512
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
nafas3633m
"
,
username
:
"
nafas3633m
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
jafar.amr
"
,
username
:
"
jafar.amr
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
sougool5382
"
,
username
:
"
sougool5382
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
maryam.maryammy
"
,
username
:
"
maryam.maryammy
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
toktam.yobi80
"
,
username
:
"
toktam.yobi80
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
roghayeh_b8082
"
,
username
:
"
roghayeh_b8082
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
turky.yyy
"
,
username
:
"
turky.yyy
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
liligoli
"
,
username
:
"
liligoli
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
soh.ila50
"
,
username
:
"
soh.ila50
"
,
count
:
1
count
:
1
},
},
{
{
username
:
"
_mrs_kz_z
"
,
username
:
"
_mrs_kz_z
"
,
count
:
1
count
:
1
},
},
]
]
}
}
\ No newline at end of file
Prev
1
2
Next
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