Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2022
441
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.93 KB | None | 1 0
  1. <?php
  2.  
  3. $user_id = YOUR USER ID HERE;
  4. $oauth = 'YOUR OAUTH TOKEN HERE';
  5.  
  6. $keys = array (
  7. "id",
  8. "createdAt",
  9. "type",
  10. "canonicalUrl",
  11. "canonicalPath",
  12. "timeZoneOffset",
  13. "editableUntil",
  14. "venue->id",
  15. "venue->name",
  16. "venue->contact->phone",
  17. "venue->contact->formattedPhone",
  18. "venue->contact->twitter",
  19. "venue->location->address",
  20. "venue->location->lat",
  21. "venue->location->lng",
  22. "venue->location->labeledLatLngs->0->label",
  23. "venue->location->labeledLatLngs->0->lat",
  24. "venue->location->labeledLatLngs->0->lng",
  25. "venue->location->postalCode",
  26. "venue->location->cc",
  27. "venue->location->city",
  28. "venue->location->state",
  29. "venue->location->country",
  30. "venue->location->contextLine",
  31. "venue->location->contextGeoId",
  32. "venue->location->formattedAddress->0",
  33. "venue->location->formattedAddress->1",
  34. "venue->canonicalUrl",
  35. "venue->canonicalPath",
  36. "venue->categories->0->id",
  37. "venue->categories->0->name",
  38. "venue->categories->0->pluralName",
  39. "venue->categories->0->shortName",
  40. "venue->categories->0->icon->prefix",
  41. "venue->categories->0->icon->mapPrefix",
  42. "venue->categories->0->icon->suffix",
  43. "venue->categories->0->primary",
  44. "venue->verified",
  45. "venue->stats->tipCount",
  46. "venue->stats->usersCount",
  47. "venue->stats->checkinsCount",
  48. "venue->url",
  49. "venue->urlSig",
  50. "venue->hasMenu",
  51. "venue->deliveryProviders->0->id",
  52. "venue->deliveryProviders->0->url",
  53. "venue->deliveryProviders->0->provider->name",
  54. "venue->deliveryProviders->0->provider->icon->prefix",
  55. "venue->deliveryProviders->0->provider->icon->sizes->0",
  56. "venue->deliveryProviders->0->provider->icon->sizes->1",
  57. "venue->deliveryProviders->0->provider->icon->name",
  58. "venue->delivery->id",
  59. "venue->delivery->url",
  60. "venue->delivery->provider->name",
  61. "venue->delivery->provider->icon->prefix",
  62. "venue->delivery->provider->icon->sizes->0",
  63. "venue->delivery->provider->icon->sizes->1",
  64. "venue->delivery->provider->icon->name",
  65. "venue->menu->type",
  66. "venue->menu->label",
  67. "venue->menu->anchor",
  68. "venue->menu->url",
  69. "venue->menu->mobileUrl",
  70. "venue->menu->canonicalPath",
  71. "venue->allowMenuUrlEdit",
  72. "venue->beenHere->lastCheckinExpiredAt",
  73. "venue->storeId",
  74. "venue->location->formattedAddress->3",
  75. "venue->inside->location->formattedAddress->3",
  76. "venue->closed",
  77. "venue->inside->closed",
  78. "venue->private",
  79. "venue->contact->instagram",
  80. "venue->contact->facebook",
  81. "venue->contact->facebookUsername",
  82. "venue->contact->facebookName",
  83. "venue->inside->id",
  84. "venue->inside->name",
  85. "venue->inside->contact->phone",
  86. "venue->inside->contact->formattedPhone",
  87. "venue->inside->contact->twitter",
  88. "venue->inside->contact->facebook",
  89. "venue->inside->contact->facebookUsername",
  90. "venue->inside->contact->facebookName",
  91. "venue->inside->location->address",
  92. "venue->inside->location->crossStreet",
  93. "venue->inside->location->lat",
  94. "venue->inside->location->lng",
  95. "venue->inside->location->labeledLatLngs->0->label",
  96. "venue->inside->location->labeledLatLngs->0->lat",
  97. "venue->inside->location->labeledLatLngs->0->lng",
  98. "venue->inside->location->postalCode",
  99. "venue->inside->location->cc",
  100. "venue->inside->location->city",
  101. "venue->inside->location->state",
  102. "venue->inside->location->country",
  103. "venue->inside->location->contextLine",
  104. "venue->inside->location->contextGeoId",
  105. "venue->inside->location->formattedAddress->0",
  106. "venue->inside->location->formattedAddress->1",
  107. "venue->inside->canonicalUrl",
  108. "venue->inside->canonicalPath",
  109. "venue->inside->categories->0->id",
  110. "venue->inside->categories->0->name",
  111. "venue->inside->categories->0->pluralName",
  112. "venue->inside->categories->0->shortName",
  113. "venue->inside->categories->0->icon->prefix",
  114. "venue->inside->categories->0->icon->mapPrefix",
  115. "venue->inside->categories->0->icon->suffix",
  116. "venue->inside->categories->0->primary",
  117. "venue->inside->verified",
  118. "venue->inside->stats->tipCount",
  119. "venue->inside->stats->usersCount",
  120. "venue->inside->stats->checkinsCount",
  121. "venue->inside->url",
  122. "venue->inside->urlSig",
  123. "venue->inside->allowMenuUrlEdit",
  124. "venue->inside->beenHere->lastCheckinExpiredAt",
  125. "venue->location->crossStreet",
  126. "venue->location->labeledLatLngs->1->label",
  127. "venue->location->labeledLatLngs->1->lat",
  128. "venue->location->labeledLatLngs->1->lng",
  129. "venue->reservations->url",
  130. "venue->reservations->provider",
  131. "venue->reservations->id",
  132. "venue->venuePage->id",
  133. "venue->menu->externalUrl",
  134. "venue->inside->reservations->url",
  135. "venue->inside->reservations->provider",
  136. "venue->inside->reservations->id",
  137. "venue->inside->venuePage->id",
  138. "venue->inside->storeId",
  139. "venue->venueRatingBlacklisted",
  140. "venue->inside->contact->instagram",
  141. "venue->inside->deliveryProviders->0->id",
  142. "venue->inside->deliveryProviders->0->url",
  143. "venue->inside->deliveryProviders->0->provider->name",
  144. "venue->inside->deliveryProviders->0->provider->icon->prefix",
  145. "venue->inside->deliveryProviders->0->provider->icon->sizes->0",
  146. "venue->inside->deliveryProviders->0->provider->icon->sizes->1",
  147. "venue->inside->deliveryProviders->0->provider->icon->name",
  148. "venue->inside->delivery->id",
  149. "venue->inside->delivery->url",
  150. "venue->inside->delivery->provider->name",
  151. "venue->inside->delivery->provider->icon->prefix",
  152. "venue->inside->delivery->provider->icon->sizes->0",
  153. "venue->inside->delivery->provider->icon->sizes->1",
  154. "venue->inside->delivery->provider->icon->name",
  155. "venue->location->neighborhood",
  156. "venue->inside->location->neighborhood",
  157. "venue->inside->hasMenu",
  158. "venue->inside->menu->type",
  159. "venue->inside->menu->label",
  160. "venue->inside->menu->anchor",
  161. "venue->inside->menu->url",
  162. "venue->inside->menu->mobileUrl",
  163. "venue->inside->menu->canonicalPath",
  164. "venue->locked",
  165. "venue->inside->locked",
  166. "venue->inside->location->labeledLatLngs->1->label",
  167. "venue->inside->location->labeledLatLngs->1->lat",
  168. "venue->inside->location->labeledLatLngs->1->lng",
  169. "venue->inside->venueRatingBlacklisted",
  170. "venue->location->formattedAddress->2",
  171. "venue->inside->location->formattedAddress->2",
  172. "venue->inside->menu->externalUrl",
  173. "venue->canonicalName",
  174. "venue->inside->canonicalName",
  175. "venue->location->isFuzzed",
  176. "like",
  177. "isMayor",
  178. "shout",
  179. "photos->count",
  180. "posts->count",
  181. "posts->textCount",
  182. "comments->count",
  183. "source->name",
  184. "source->url",
  185. "score->total",
  186. "likes->count",
  187. "likes->groups->0->type",
  188. "likes->groups->0->count",
  189. "likes->groups->0->items->0->id",
  190. "likes->groups->0->items->0->firstName",
  191. "likes->groups->0->items->0->lastName",
  192. "likes->groups->0->items->0->gender",
  193. "likes->groups->0->items->0->address",
  194. "likes->groups->0->items->0->city",
  195. "likes->groups->0->items->0->state",
  196. "likes->groups->0->items->0->countryCode",
  197. "likes->groups->0->items->0->relationship",
  198. "likes->groups->0->items->0->canonicalUrl",
  199. "likes->groups->0->items->0->canonicalPath",
  200. "likes->groups->0->items->0->photo->prefix",
  201. "likes->groups->0->items->0->photo->suffix",
  202. "likes->groups->0->items->0->isAnonymous",
  203. "likes->summary",
  204. "likes->groups->0->items->1->id",
  205. "likes->groups->0->items->1->firstName",
  206. "likes->groups->0->items->1->lastName",
  207. "likes->groups->0->items->1->gender",
  208. "likes->groups->0->items->1->address",
  209. "likes->groups->0->items->1->city",
  210. "likes->groups->0->items->1->state",
  211. "likes->groups->0->items->1->countryCode",
  212. "likes->groups->0->items->1->relationship",
  213. "likes->groups->0->items->1->canonicalUrl",
  214. "likes->groups->0->items->1->canonicalPath",
  215. "likes->groups->0->items->1->photo->prefix",
  216. "likes->groups->0->items->1->photo->suffix",
  217. "likes->groups->0->items->1->isAnonymous",
  218. "sticker->id",
  219. "sticker->name",
  220. "sticker->image->prefix",
  221. "sticker->image->sizes->0",
  222. "sticker->image->sizes->1",
  223. "sticker->image->sizes->2",
  224. "sticker->image->sizes->3",
  225. "sticker->image->name",
  226. "sticker->stickerType",
  227. "sticker->group->name",
  228. "sticker->group->index",
  229. "sticker->pickerPosition->page",
  230. "sticker->pickerPosition->index",
  231. "sticker->teaseText",
  232. "sticker->unlockText",
  233. "sticker->bonusText",
  234. "sticker->points",
  235. "sticker->bonusStatus",
  236. "stickerPowerup->bonusType",
  237. "stickerPowerup->value",
  238. "showStickerUpsell",
  239.  
  240. "overlaps->count",
  241. "overlaps->summary",
  242. "overlaps->items->0->id",
  243. "overlaps->items->0->createdAt",
  244. "overlaps->items->0->type",
  245. "overlaps->items->0->canonicalUrl",
  246. "overlaps->items->0->canonicalPath",
  247. "overlaps->items->0->timeZoneOffset",
  248. "overlaps->items->0->user->id",
  249. "overlaps->items->0->user->firstName",
  250. "overlaps->items->0->user->lastName",
  251. "overlaps->items->0->user->gender",
  252. "overlaps->items->0->user->countryCode",
  253. "overlaps->items->0->user->relationship",
  254. "overlaps->items->0->user->canonicalUrl",
  255. "overlaps->items->0->user->canonicalPath",
  256. "overlaps->items->0->user->photo->prefix",
  257. "overlaps->items->0->user->photo->suffix",
  258. "overlaps->items->0->user->isAnonymous",
  259. "event->id",
  260. "event->name",
  261. "event->categories->0->id",
  262. "event->categories->0->name",
  263. "event->categories->0->pluralName",
  264. "event->categories->0->shortName",
  265. "event->categories->0->icon->prefix",
  266. "event->categories->0->icon->mapPrefix",
  267. "event->categories->0->icon->suffix",
  268. "event->categories->0->primary",
  269. "photos->items->0->id",
  270. "photos->items->0->createdAt",
  271. "photos->items->0->source->name",
  272. "photos->items->0->source->url",
  273. "photos->items->0->prefix",
  274. "photos->items->0->suffix",
  275. "photos->items->0->width",
  276. "photos->items->0->height",
  277. "photos->items->0->user->id",
  278. "photos->items->0->user->firstName",
  279. "photos->items->0->user->lastName",
  280. "photos->items->0->user->gender",
  281. "photos->items->0->user->countryCode",
  282. "photos->items->0->user->relationship",
  283. "photos->items->0->user->canonicalUrl",
  284. "photos->items->0->user->canonicalPath",
  285. "photos->items->0->user->photo->prefix",
  286. "photos->items->0->user->photo->suffix",
  287. "photos->items->0->user->isAnonymous",
  288. "photos->items->0->visibility",
  289. "photos->layout->name",
  290. "photos->items->0->hasSticker",
  291. "ratedAt",
  292. "likes->groups->0->items->2->id",
  293. "likes->groups->0->items->2->firstName",
  294. "likes->groups->0->items->2->lastName",
  295. "likes->groups->0->items->2->gender",
  296. "likes->groups->0->items->2->countryCode",
  297. "likes->groups->0->items->2->relationship",
  298. "likes->groups->0->items->2->canonicalUrl",
  299. "likes->groups->0->items->2->canonicalPath",
  300. "likes->groups->0->items->2->photo->prefix",
  301. "likes->groups->0->items->2->photo->suffix",
  302. "likes->groups->0->items->2->isAnonymous",
  303. "photos->items->1->id",
  304. "photos->items->1->createdAt",
  305. "photos->items->1->source->name",
  306. "photos->items->1->source->url",
  307. "photos->items->1->prefix",
  308. "photos->items->1->suffix",
  309. "photos->items->1->width",
  310. "photos->items->1->height",
  311. "photos->items->1->user->id",
  312. "photos->items->1->user->firstName",
  313. "photos->items->1->user->lastName",
  314. "photos->items->1->user->gender",
  315. "photos->items->1->user->countryCode",
  316. "photos->items->1->user->relationship",
  317. "photos->items->1->user->canonicalUrl",
  318. "photos->items->1->user->canonicalPath",
  319. "photos->items->1->user->photo->prefix",
  320. "photos->items->1->user->photo->suffix",
  321. "photos->items->1->user->isAnonymous",
  322. "photos->items->1->visibility",
  323. "photos->items->2->id",
  324. "photos->items->2->createdAt",
  325. "photos->items->2->source->name",
  326. "photos->items->2->source->url",
  327. "photos->items->2->prefix",
  328. "photos->items->2->suffix",
  329. "photos->items->2->width",
  330. "photos->items->2->height",
  331. "photos->items->2->user->id",
  332. "photos->items->2->user->firstName",
  333. "photos->items->2->user->lastName",
  334. "photos->items->2->user->gender",
  335. "photos->items->2->user->countryCode",
  336. "photos->items->2->user->relationship",
  337. "photos->items->2->user->canonicalUrl",
  338. "photos->items->2->user->canonicalPath",
  339. "photos->items->2->user->photo->prefix",
  340. "photos->items->2->user->photo->suffix",
  341. "photos->items->2->user->isAnonymous",
  342. "photos->items->2->visibility",
  343. "photos->items->3->id",
  344. "photos->items->3->createdAt",
  345. "photos->items->3->source->name",
  346. "photos->items->3->source->url",
  347. "photos->items->3->prefix",
  348. "photos->items->3->suffix",
  349. "photos->items->3->width",
  350. "photos->items->3->height",
  351. "photos->items->3->user->id",
  352. "photos->items->3->user->firstName",
  353. "photos->items->3->user->lastName",
  354. "photos->items->3->user->gender",
  355. "photos->items->3->user->countryCode",
  356. "photos->items->3->user->relationship",
  357. "photos->items->3->user->canonicalUrl",
  358. "photos->items->3->user->canonicalPath",
  359. "photos->items->3->user->photo->prefix",
  360. "photos->items->3->user->photo->suffix",
  361. "photos->items->3->user->isAnonymous",
  362. "photos->items->3->visibility",
  363. "photos->items->4->id",
  364. "photos->items->4->createdAt",
  365. "photos->items->4->source->name",
  366. "photos->items->4->source->url",
  367. "photos->items->4->prefix",
  368. "photos->items->4->suffix",
  369. "photos->items->4->width",
  370. "photos->items->4->height",
  371. "photos->items->4->user->id",
  372. "photos->items->4->user->firstName",
  373. "photos->items->4->user->lastName",
  374. "photos->items->4->user->gender",
  375. "photos->items->4->user->countryCode",
  376. "photos->items->4->user->relationship",
  377. "photos->items->4->user->canonicalUrl",
  378. "photos->items->4->user->canonicalPath",
  379. "photos->items->4->user->photo->prefix",
  380. "photos->items->4->user->photo->suffix",
  381. "photos->items->4->user->isAnonymous",
  382. "photos->items->4->visibility",
  383. "photos->items->5->id",
  384. "photos->items->5->createdAt",
  385. "photos->items->5->source->name",
  386. "photos->items->5->source->url",
  387. "photos->items->5->prefix",
  388. "photos->items->5->suffix",
  389. "photos->items->5->width",
  390. "photos->items->5->height",
  391. "photos->items->5->user->id",
  392. "photos->items->5->user->firstName",
  393. "photos->items->5->user->lastName",
  394. "photos->items->5->user->gender",
  395. "photos->items->5->user->countryCode",
  396. "photos->items->5->user->relationship",
  397. "photos->items->5->user->canonicalUrl",
  398. "photos->items->5->user->canonicalPath",
  399. "photos->items->5->user->photo->prefix",
  400. "photos->items->5->user->photo->suffix",
  401. "photos->items->5->user->isAnonymous",
  402. "photos->items->5->visibility",
  403. "photos->items->6->id",
  404. "photos->items->6->createdAt",
  405. "photos->items->6->source->name",
  406. "photos->items->6->source->url",
  407. "photos->items->6->prefix",
  408. "photos->items->6->suffix",
  409. "photos->items->6->width",
  410. "photos->items->6->height",
  411. "photos->items->6->user->id",
  412. "photos->items->6->user->firstName",
  413. "photos->items->6->user->lastName",
  414. "photos->items->6->user->gender",
  415. "photos->items->6->user->countryCode",
  416. "photos->items->6->user->relationship",
  417. "photos->items->6->user->canonicalUrl",
  418. "photos->items->6->user->canonicalPath",
  419. "photos->items->6->user->photo->prefix",
  420. "photos->items->6->user->photo->suffix",
  421. "photos->items->6->user->isAnonymous",
  422. "photos->items->6->visibility",
  423. "photos->layout->top->id",
  424. "photos->layout->bottomLeft->id",
  425. "photos->layout->bottomRight->id",
  426. "photos->layout->left->id",
  427. "photos->layout->right->id",
  428. "likes->groups->1->type",
  429. "likes->groups->1->count",
  430. "likes->groups->1->items->0->id",
  431. "likes->groups->1->items->0->firstName",
  432. "likes->groups->1->items->0->lastName",
  433. "likes->groups->1->items->0->gender",
  434. "likes->groups->1->items->0->countryCode",
  435. "likes->groups->1->items->0->canonicalUrl",
  436. "likes->groups->1->items->0->canonicalPath",
  437. "likes->groups->1->items->0->photo->prefix",
  438. "likes->groups->1->items->0->photo->suffix",
  439. "likes->groups->1->items->0->isAnonymous",
  440. "likes->groups->1->items->0->address",
  441. "likes->groups->1->items->0->city",
  442. "likes->groups->1->items->0->state",
  443. "likes->groups->1->items->0->relationship",
  444. "likes->groups->0->items->2->address",
  445. "likes->groups->0->items->2->city",
  446. "likes->groups->0->items->2->state",
  447. "sticker->effects->0->type",
  448. "sticker->effects->0->detail->prefix",
  449. "sticker->effects->0->detail->sizes->0",
  450. "sticker->effects->0->detail->name",
  451. "venue->location->formattedAddress->4",
  452. "venue->inside->location->formattedAddress->4",
  453. "entities->0->indices->0",
  454. "entities->0->indices->1",
  455. "entities->0->type",
  456. "entities->0->id",
  457. "entities->1->indices->0",
  458. "entities->1->indices->1",
  459. "entities->1->type",
  460. "entities->1->id",
  461. "with->0->id",
  462. "with->0->firstName",
  463. "with->0->lastName",
  464. "with->0->gender",
  465. "with->0->countryCode",
  466. "with->0->relationship",
  467. "with->0->canonicalUrl",
  468. "with->0->canonicalPath",
  469. "with->0->photo->prefix",
  470. "with->0->photo->suffix",
  471. "with->0->isAnonymous",
  472. "with->1->id",
  473. "with->1->firstName",
  474. "with->1->lastName",
  475. "with->1->gender",
  476. "with->1->countryCode",
  477. "with->1->relationship",
  478. "with->1->canonicalUrl",
  479. "with->1->canonicalPath",
  480. "with->1->photo->prefix",
  481. "with->1->photo->suffix",
  482. "with->1->isAnonymous",
  483. "overlaps->items->0->createdBy->id",
  484. "overlaps->items->0->createdBy->firstName",
  485. "overlaps->items->0->createdBy->lastName",
  486. "overlaps->items->0->createdBy->gender",
  487. "overlaps->items->0->createdBy->countryCode",
  488. "overlaps->items->0->createdBy->relationship",
  489. "overlaps->items->0->createdBy->canonicalUrl",
  490. "overlaps->items->0->createdBy->canonicalPath",
  491. "overlaps->items->0->createdBy->photo->prefix",
  492. "overlaps->items->0->createdBy->photo->suffix",
  493. "overlaps->items->0->createdBy->isAnonymous",
  494. "overlaps->items->1->id",
  495. "overlaps->items->1->createdAt",
  496. "overlaps->items->1->type",
  497. "overlaps->items->1->entities->0->indices->0",
  498. "overlaps->items->1->entities->0->indices->1",
  499. "overlaps->items->1->entities->0->type",
  500. "overlaps->items->1->entities->0->id",
  501. "overlaps->items->1->entities->1->indices->0",
  502. "overlaps->items->1->entities->1->indices->1",
  503. "overlaps->items->1->entities->1->type",
  504. "overlaps->items->1->entities->1->id",
  505. "overlaps->items->1->shout",
  506. "overlaps->items->1->canonicalUrl",
  507. "overlaps->items->1->canonicalPath",
  508. "overlaps->items->1->timeZoneOffset",
  509. "overlaps->items->1->with->0->id",
  510. "overlaps->items->1->with->0->firstName",
  511. "overlaps->items->1->with->0->lastName",
  512. "overlaps->items->1->with->0->gender",
  513. "overlaps->items->1->with->0->countryCode",
  514. "overlaps->items->1->with->0->relationship",
  515. "overlaps->items->1->with->0->canonicalUrl",
  516. "overlaps->items->1->with->0->canonicalPath",
  517. "overlaps->items->1->with->0->photo->prefix",
  518. "overlaps->items->1->with->0->photo->suffix",
  519. "overlaps->items->1->with->0->isAnonymous",
  520. "overlaps->items->1->with->1->id",
  521. "overlaps->items->1->with->1->firstName",
  522. "overlaps->items->1->with->1->lastName",
  523. "overlaps->items->1->with->1->gender",
  524. "overlaps->items->1->with->1->countryCode",
  525. "overlaps->items->1->with->1->relationship",
  526. "overlaps->items->1->with->1->canonicalUrl",
  527. "overlaps->items->1->with->1->canonicalPath",
  528. "overlaps->items->1->with->1->photo->prefix",
  529. "overlaps->items->1->with->1->photo->suffix",
  530. "overlaps->items->1->with->1->isAnonymous",
  531. "overlaps->items->1->user->id",
  532. "overlaps->items->1->user->firstName",
  533. "overlaps->items->1->user->lastName",
  534. "overlaps->items->1->user->gender",
  535. "overlaps->items->1->user->countryCode",
  536. "overlaps->items->1->user->relationship",
  537. "overlaps->items->1->user->canonicalUrl",
  538. "overlaps->items->1->user->canonicalPath",
  539. "overlaps->items->1->user->photo->prefix",
  540. "overlaps->items->1->user->photo->suffix",
  541. "overlaps->items->1->user->isAnonymous",
  542. "overlaps->items->1->createdBy->id",
  543. "overlaps->items->1->createdBy->firstName",
  544. "overlaps->items->1->createdBy->lastName",
  545. "overlaps->items->1->createdBy->gender",
  546. "overlaps->items->1->createdBy->countryCode",
  547. "overlaps->items->1->createdBy->relationship",
  548. "overlaps->items->1->createdBy->canonicalUrl",
  549. "overlaps->items->1->createdBy->canonicalPath",
  550. "overlaps->items->1->createdBy->photo->prefix",
  551. "overlaps->items->1->createdBy->photo->suffix",
  552. "overlaps->items->1->createdBy->isAnonymous",
  553. "overlaps->items->0->entities->0->indices->0",
  554. "overlaps->items->0->entities->0->indices->1",
  555. "overlaps->items->0->entities->0->type",
  556. "overlaps->items->0->entities->0->id",
  557. "overlaps->items->0->entities->1->indices->0",
  558. "overlaps->items->0->entities->1->indices->1",
  559. "overlaps->items->0->entities->1->type",
  560. "overlaps->items->0->entities->1->id",
  561. "overlaps->items->0->shout",
  562. "overlaps->items->0->with->0->id",
  563. "overlaps->items->0->with->0->firstName",
  564. "overlaps->items->0->with->0->lastName",
  565. "overlaps->items->0->with->0->gender",
  566. "overlaps->items->0->with->0->countryCode",
  567. "overlaps->items->0->with->0->relationship",
  568. "overlaps->items->0->with->0->canonicalUrl",
  569. "overlaps->items->0->with->0->canonicalPath",
  570. "overlaps->items->0->with->0->photo->prefix",
  571. "overlaps->items->0->with->0->photo->suffix",
  572. "overlaps->items->0->with->0->isAnonymous",
  573. "overlaps->items->0->with->1->id",
  574. "overlaps->items->0->with->1->firstName",
  575. "overlaps->items->0->with->1->lastName",
  576. "overlaps->items->0->with->1->gender",
  577. "overlaps->items->0->with->1->countryCode",
  578. "overlaps->items->0->with->1->relationship",
  579. "overlaps->items->0->with->1->canonicalUrl",
  580. "overlaps->items->0->with->1->canonicalPath",
  581. "overlaps->items->0->with->1->photo->prefix",
  582. "overlaps->items->0->with->1->photo->suffix",
  583. "overlaps->items->0->with->1->isAnonymous",
  584. "private",
  585. "visibility",
  586. );
  587.  
  588. $offset = 0;
  589. $limit = 100;
  590.  
  591. $ch = curl_init ("https://api.foursquare.com/v2/users/" . $user_id . "/historysearch?locale=en&v=20220920&offset=".$offset."&limit=1&sort=newestfirst&oauth_token=$oauth");
  592.  
  593. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  594. curl_setopt($ch, CURLOPT_HEADER, false);
  595.  
  596. $data = json_decode ( curl_exec ($ch), false);
  597. $checkins = $data->response->checkins->count;
  598. echo "Scraping $checkins checkins for user $user_id...\n";
  599. curl_close ($ch);
  600.  
  601. $fhandle = fopen ("swarm-$user_id.csv", "w");
  602. if ($fhandle == null)
  603. {
  604. echo "Can't open file for writing\n";
  605. return;
  606. }
  607.  
  608. $delim = '';
  609. foreach ($keys as $key)
  610. {
  611. fwrite ($fhandle, $delim . $key);
  612. $delim =',';
  613. }
  614. fwrite ($fhandle, "\n");
  615.  
  616. while ($offset < $checkins)
  617. {
  618. echo " Grabbing checkins starting at $offset ...\n";
  619. $query_size = 0;
  620. if ($offset + $limit > $checkins)
  621. $query_size = $checkins - $offset;
  622. else
  623. $query_size = 100;
  624.  
  625. $cd = get_checkin_data ($offset, $query_size, $user_id, $oauth);
  626.  
  627. for ($index = 0; $index < count ($cd); $index ++)
  628. {
  629. $delim = "";
  630. foreach ($keys as &$key)
  631. {
  632. $fdata = extract_path ($cd [$index], explode ('->', $key));
  633. // Added 11/2/2022
  634. // Need to escape the comma that may appear in the string
  635. $fdata = str_replace (',', '&comma;', $fdata);
  636. fwrite ($fhandle, $delim . $fdata);
  637. $delim = ",";
  638. }
  639. fwrite ($fhandle, "\n");
  640. // This code was used to create the list of json fields
  641.  
  642. /*
  643. foreach ($cd [$index] as $key => $value)
  644. {
  645. $is_unique = true;
  646. for ($j = 0; $j < count ($keys); $j ++)
  647. {
  648. if ($keys [$j] === $key)
  649. $is_unique = false;
  650. }
  651. if ($is_unique)
  652. $keys [count ($keys)] = $key;
  653. }
  654. */
  655. }
  656. $offset = $offset + $query_size;
  657. sleep (5);
  658. }
  659.  
  660. fclose ($fhandle);
  661. return ;
  662.  
  663. function recursive_key ($prefix, $var)
  664. {
  665. global $keys;
  666. foreach ($var as $key => $value)
  667. {
  668.  
  669. if (is_array ($value))
  670. recursive_key ($prefix . "->" . $key, $var [$key]);
  671. else
  672. {
  673. $is_unique = true;
  674. for ($j = 0; $j < count ($keys); $j ++)
  675. {
  676. if ($keys [$j] === $prefix . "->" . $key)
  677. $is_unique = false;
  678. }
  679. if ($is_unique)
  680. $keys [count ($keys)] = $prefix . "->" . $key;
  681.  
  682. }
  683. }
  684. }
  685.  
  686. function get_checkin_data ($o, $q, $u, $a)
  687. {
  688. $ch = curl_init ("https://api.foursquare.com/v2/users/" . $u . "/historysearch?locale=en&v=20220920&offset=" . $o . "&limit=" . $q . "&sort=newestfirst&oauth_token=$a");
  689.  
  690. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  691. curl_setopt($ch, CURLOPT_HEADER, false);
  692.  
  693. $data = json_decode ( curl_exec ($ch), true);
  694. curl_close ($ch);
  695.  
  696. return $data ['response']['checkins']['items'];
  697. //return $data->response->checkins->items;
  698. }
  699.  
  700. function extract_path (&$data, $path)
  701. {
  702. $rest = $data[$path[0]] ?? null;
  703. if ($rest == null)
  704. {
  705. return null;
  706. }
  707.  
  708. if (count($path) == 1)
  709. return $rest;
  710. else
  711. return extract_path($rest, array_slice($path, 1));
  712. }
  713.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement