Jump to content

tomasanjosbarao

Members
  • Posts

    13
  • Joined

  • Last visited

Contact Methods

  • Website URL
    https://tomasbarao.pt

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tomasanjosbarao's Achievements

Jr. Member

Jr. Member (3/6)

4

Reputation

  1. This is just awesome! 😃 I wish I had seen this example some years earlier when I started in ProcessWire. This got me the inspiration and specially the confidence to create some apps in the future. Looks so easy after all.
  2. After strolling aroung the chaotic interface of the Facebook Developers platform, I could find the place to create an Access Token. Seems you need to add the app "Instagram API with Instagram Login" and not anymore the "Instagram Basic Display". Once you have the access token and authorize it: $http = new WireHttp(); $http->setData([ // Choose the fields you want; you will need the user_id at least 'fields' => 'user_id,username,followers_count,follows_count,media_count,profile_picture_url', 'access_token' => $igAccessToken, ]); $response = $http->get('https://graph.instagram.com/v20.0/me'); if ($response !== false) { // The answer comes as JSON, I cast it to an array so I could store it in ProcessWire's cache $profile = (array)json_decode($response); } else { // Your error procedure here } The response will be like: [ 'user_id' => '17941778910156051', 'username' => 'yourusername' 'followers_count' => 1560 'follows_count' => 294 'media_count' => 231 'profile_picture_url' => '...' 'id' => '3317109405575570' ] Pay attention to the "user_id": it is a scoped, temporary ID (valid for one hour, I guess) that you'll need to insert on the URL to finally get the posts on a subsequent request, like this: $newHttp = new WireHttp(); $newHttp->setData([ 'fields' => 'id,caption,media_url,media_type,timestamp,permalink,thumbnail_url', // Again, choose what you need 'limit' => '14', // Optional 'access_token' => $igAccessToken, // The same as before ]); $newResponse = $newHttp->get('https://graph.instagram.com/v20.0/'.$profile['user_id'].'/media'); if ($newResponse !== false) { // Once again this is my preference, you can use it as an object $posts = (array)json_decode($newResponse); } else { // Your error procedure here } And by doing this I am not needing your module anymore. Hope this is useful, and hope they don't change things too much soon.
  3. Meta is going to disable Instagram Basic Display API, starting on December 4th, 2024. I'm trying to figure out what to do next. (Two weeks ago I was trying to use this module for the first time, for a client of mine, and the process of setting up an app with them is nuts, with the amount of data they ask from us and the confusing and complex interface of their developer thingy...) Thanks for the module, Chris.
  4. Most of the times I use redirects for temporary purposes, usually for short links that should change over time (for example, `https://mysite.org/conference-signup`). So it was important for me that this module could redirect with other status codes, mainly 302, instead of 301. I haven't created any ProcessWire modules yet, but I decided to try and improve apeisa's module, and I got it to work like I wanted, so I thought I should contribute this to the community. I know I should make a pull request, but I'm not experienced in git yet and I have little time now, so the best I can do now is leave here the file for you to see if you want. I'm sorry for this. I added a column "status" to the table process_redirects, like this: `status` enum('301','302','303','307') NOT NULL DEFAULT '302', I only used the status codes specified on the documentation for $session->redirect. In future I'd like to specify them in a constant or static property (not sure), and then use it to generate the options in the edit form. I haven't bumped version, and I'm not sure how to procceed about updating the database schema. Could you have a look, please? ProcessRedirects-tomasanjosbarao.module
  5. By disabling Autojoin it works! Thanks, @wbmnfktr! Is it normal that it doesn't work when autojoined, or is it a bug?
  6. Hey guys, I'm having a hard time troubleshooting this one: my multilanguage fields save data outside repeaters, but inside any repeater they just won't save, unlike all other fieldtypes. What I've tried so far: Recreating the repeater matrix from scratch — problem persists Using multi-language fields on a regular repeater instead of a repeater matrix — problem persists Removing all language support modules and reinstalling — problem persists If I change the multi-language fields into single-language types, they start saving right, but if I change them back to multi-language, the problem persists. Changing the multilanguage field via API `$page->repeaterfield[0]->setAndSave("title","Meow")` — works, but I need it in the admin form To try to figure out the problem I did this: $wire->addHookAfter("Pages::saved(template=repeater_content)", function($event) { $page = $event->arguments(0); $changes = $event->arguments(1); $values = $event->arguments(2); bdb($page); bdb($changes); bdb($values); }); The hook is only triggered when I also change a non-multi-language field. On the dumped $page the title field is there like I changed it in the form. But something must happen after Page::saved that restores it back to what it was. Where would you look next to find the solution...? Thank you very much for your help!
  7. Thanks for your work, Robin. ? Has someone had "The page isn’t redirecting properly" problems with this module...? I disabled LanguageSupportPageNames and have not installed PagePathHistory; tried different pages in both the canonical url and my chosen url and this always happens. Despite the good considerations on this post about avoiding changing paths, I think most people will eventually need this type of functionality.
  8. Thank you for the good advice (specially on mantaining a healthy subscriber list). ? It seems feasible to use your own SMTP, as long as you keep within the hosting provider's limitations and set up everything correctly. https://www.mail-tester.com/ is a great help.
  9. I love ProcessWire and I'm considering buying ProMailer for the company I work in. We send a newsletter to ~1500 adresses about three times a month. Do you think it's imperative to subscribe an SMTP service like Mailgun? As long as SPF, DKIM and DMARC are correctly set up, is it reliable to use just your own SMTP, from your shared hosting? Is there anyone here using ProMailer without an external service? Thank you for your advice.
  10. Great, then, I'll wait for the tutorial and meanwhile I might get some time to explore.
  11. Can I still join, @bernhard? I'd really like to learn this. Thanks!
×
×
  • Create New...