{"id":23817910,"url":"https://github.com/lsongdev/maimai-js","last_synced_at":"2025-07-27T04:40:49.760Z","repository":{"id":68773884,"uuid":"342215170","full_name":"lsongdev/maimai-js","owner":"lsongdev","description":"maimai.cn(脉脉) javascript api","archived":false,"fork":false,"pushed_at":"2021-08-16T07:24:37.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T22:23:43.994Z","etag":null,"topics":["javascript-api","networking","web"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lsongdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"song940","patreon":"song940","open_collective":"song940","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://git.io/fjRcB"}},"created_at":"2021-02-25T11:00:13.000Z","updated_at":"2025-01-19T13:18:42.000Z","dependencies_parsed_at":"2023-02-26T22:45:29.019Z","dependency_job_id":null,"html_url":"https://github.com/lsongdev/maimai-js","commit_stats":null,"previous_names":["lsongdev/maimai-js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fmaimai-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fmaimai-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fmaimai-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsongdev%2Fmaimai-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsongdev","download_url":"https://codeload.github.com/lsongdev/maimai-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240093154,"owners_count":19746780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript-api","networking","web"],"created_at":"2025-01-02T05:49:04.281Z","updated_at":"2025-02-21T21:57:30.913Z","avatar_url":"https://github.com/lsongdev.png","language":"JavaScript","funding_links":["https://github.com/sponsors/song940","https://patreon.com/song940","https://opencollective.com/song940","https://git.io/fjRcB"],"categories":[],"sub_categories":[],"readme":"## maimai 脉脉\n\n\u003e 成就职业梦想\n\nmaimai javascript api\n\n### how to install\n\n```sh\n~$ npm i maimai --save\n```\n\n### how to use\n \n#### chat example \n\n```js\nconst maimai = require('maimai');\n\nconst chat = new maimai.Chat({\n  u: '888888888', // user id\n  access_token: '-- YOUR ACCESS TOKEN HERE --',\n});\n\nchat.on('message', (who, message) =\u003e {\n  cconsole.log('You have a new message from:', who, message);\n});\n\n(async () =\u003e {\n\n  // 获取好友列表\n  const { data: contacts } = await chat.pbd1();\n  for (const contact of contacts) {\n    console.log(contact);\n  }\n\n  // 获取好友会话消息\n  const { dialogues } = await chat.get_dlg('21983888');\n  for (const dialog of dialogues) {\n    console.log(dialog);\n  }\n\n  // 给好友发送消息\n  const res2 = await chat.send('21983888', \"hello\");\n  console.log(res2);\n  \n})();\n```\n\n#### enterprise example\n\n```js\nconst maimai = require('maimai');\n\nconst session = {\n  u: 'user id',\n  access_token: 'access token'\n};\n\nconst enterprise = new maimai.Enterprise(session);\n\n(async () =\u003e {\n  const jid = 3750925;\n  // 根据发布的职位 ID 获取推荐的候选人\n  const { contacts } = await enterprise.recommend(jid, { page: 1 });\n  for (const contact of contacts) {\n    console.log(contact.id, contact.name);\n    // 极速联系候选人\n    const res = await enterprise.send(contact.id, `请问您对我发布的 \\\"前端研发工程师\\\" 职位感兴趣吗？`, { jid });\n    console.log(res);\n  }\n})();\n```\n\n### license\n\nThis project is under MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fmaimai-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsongdev%2Fmaimai-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsongdev%2Fmaimai-js/lists"}