2020-02-24 22:56:19 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
2020-02-24 23:01:10 +00:00
|
|
|
models "../models"
|
|
|
|
config "../models/config"
|
|
|
|
"fmt"
|
2020-02-24 22:56:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// GetUserUploads - Get all uploads marked with given hashtag
|
2020-02-25 19:16:57 +00:00
|
|
|
func GetHashtagUploads(hashtagURL string) ([]models.Upload, error) {
|
2020-02-24 23:01:10 +00:00
|
|
|
jsMethod := fmt.Sprintf("bootstrapIteratingVideos(%d)", config.Config.Limit)
|
2020-02-25 19:16:57 +00:00
|
|
|
actionOutput, err := executeClientAction(hashtagURL, jsMethod)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return models.ParseUploads(actionOutput), nil
|
2020-02-24 22:56:19 +00:00
|
|
|
}
|
|
|
|
|
2020-02-25 19:16:57 +00:00
|
|
|
func GetHashtagUploadsJson(hashtagURL string) (string, error) {
|
2020-02-24 23:01:10 +00:00
|
|
|
jsMethod := fmt.Sprintf("bootstrapIteratingVideos(%d)", config.Config.Limit)
|
2020-02-25 19:16:57 +00:00
|
|
|
actionOutput, err := executeClientAction(hashtagURL, jsMethod)
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
return actionOutput, nil
|
2020-02-24 23:01:10 +00:00
|
|
|
}
|