emusks 2.0.8 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/graphql.js +1 -2
- package/src/helpers/search.js +15 -0
package/package.json
CHANGED
package/src/graphql.js
CHANGED
package/src/helpers/search.js
CHANGED
|
@@ -114,6 +114,21 @@ export async function communities(query, opts = {}) {
|
|
|
114
114
|
return parseTimeline(raw);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
export async function gifs(query, params = {}) {
|
|
118
|
+
const res = await this.v1_1("foundmedia/search", {
|
|
119
|
+
params: {
|
|
120
|
+
q: query,
|
|
121
|
+
...(params.cursor ? { cursor: params.cursor } : {}),
|
|
122
|
+
...params,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
const json = await res.json();
|
|
126
|
+
return {
|
|
127
|
+
items: json.data?.items || [],
|
|
128
|
+
cursor: json.cursor?.next || null,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
117
132
|
export async function communitiesLatest(query, opts = {}) {
|
|
118
133
|
const raw = await this.graphql("GlobalCommunitiesLatestPostSearchTimeline", {
|
|
119
134
|
variables: {
|