Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import app from "../../genderize.app.mjs";

export default {
key: "genderize-get-gender-from-name",
name: "Get Gender From Name",
description: "Check the statistical probability of a name being male or female. [See the documentation](https://genderize.io/documentation#basic-usage)",
version: "0.0.1",
type: "action",
props: {
app,
name: {
propDefinition: [
app,
"name",
],
},
},
async run({ $ }) {
const response = await this.app.getGenderFromName({
$,
params: {
name: this.name,
},
});
$.export("$summary", `Successfully sent the request. Result: ${response.gender}`);
return response;
},
};
35 changes: 31 additions & 4 deletions components/genderize/genderize.app.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "genderize",
propDefinitions: {},
propDefinitions: {
name: {
type: "string",
label: "Name",
description: "Name that will be checked",
},
},
methods: {
// this.$auth contains connected account data
authKeys() {
console.log(Object.keys(this.$auth));
_baseUrl() {
return "https://api.genderize.io";
},
async _makeRequest(opts = {}) {
const {
$ = this,
params,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl(),
params: {
api_key: `${this.$auth.api_key}`,
...params,
},
});
},
async getGenderFromName(args = {}) {
return this._makeRequest({
...args,
});
},
},
};
3 changes: 3 additions & 0 deletions components/genderize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
17 changes: 10 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading