<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: auct</title>
    <description>The latest articles on Forem by auct (@auct).</description>
    <link>https://forem.com/auct</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F379%2F2072488.png</url>
      <title>Forem: auct</title>
      <link>https://forem.com/auct</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/auct"/>
    <language>en</language>
    <item>
      <title>I don't like js. I don't like htmx. So I created uajax - library to make form ajaxed</title>
      <dc:creator>auct</dc:creator>
      <pubDate>Wed, 10 May 2023 04:36:39 +0000</pubDate>
      <link>https://forem.com/auct/i-dont-like-js-i-dont-like-htmx-so-i-created-uajax-library-to-make-form-ajaxed-57mh</link>
      <guid>https://forem.com/auct/i-dont-like-js-i-dont-like-htmx-so-i-created-uajax-library-to-make-form-ajaxed-57mh</guid>
      <description>&lt;h2&gt;
  
  
  Backstory
&lt;/h2&gt;

&lt;p&gt;Nearly two years (actually almost three) ago, I was migrating admin panel from bootsrap 4 to bootstrap 5 alpha.&lt;br&gt;
I was using a lot of jquery and a lot of jquery ajax functions that were written like 10 years ago.&lt;br&gt;
So to clean this mess I wanted to make single func to rule them all.&lt;/p&gt;

&lt;p&gt;With new bootstrap 5 without jquery I searched for something. I even tried htmx. But I didn't like it. I also don't like js (at that time).&lt;/p&gt;

&lt;p&gt;So what to do if you want to remove jquery dependency, don't like js, and don't like htmx because its syntax is meh? Right - you write your own library 😍&lt;/p&gt;

&lt;h2&gt;
  
  
  uajax - universal ajax forms
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://auct.github.io/uajax/demo"&gt;Demo Requests&lt;/a&gt;&lt;br&gt;
&lt;a href="https://auct.github.io/uajax/demo/todo2.html"&gt;Demo Todo App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've made uajax, and it was like add class &lt;code&gt;js-uajax-form&lt;/code&gt; to any form, and you're done.&lt;br&gt;
There are a lot of features you can enable with data attributes (like hide target, insert into target, remove target, reload, redirect and so on).&lt;/p&gt;

&lt;p&gt;I know I'm biased but still this shi* is awesome.&lt;/p&gt;

&lt;h2&gt;
  
  
  ajax-button - make any button ajaxed
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://auct.github.io/ajax-button/demo"&gt;Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There were some moments when adding form is too much, I needed to make uajax for single button. So I made function ajax-button to make button ajaxed. Today I published it. Adding settings made it 2x size, in original it was a bit simpler :(. Feel free to modify it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Sometimes, when you need something and can't find, you can make it.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>showdev</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Post to facebook page using api with plain php</title>
      <dc:creator>auct</dc:creator>
      <pubDate>Thu, 27 Apr 2023 04:35:47 +0000</pubDate>
      <link>https://forem.com/auct/how-to-post-to-facebook-page-using-api-with-plain-php-1nkf</link>
      <guid>https://forem.com/auct/how-to-post-to-facebook-page-using-api-with-plain-php-1nkf</guid>
      <description>&lt;p&gt;If you want to post to your facebook page using api you need to waste few hours or read this short guide.&lt;/p&gt;

&lt;p&gt;You should have facebook app. If not - create one.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Get Short User Token
&lt;/h2&gt;

&lt;p&gt;Get short user live token here &lt;a href="https://developers.facebook.com/tools/explorer"&gt;https://developers.facebook.com/tools/explorer&lt;/a&gt;. Check permissions: &lt;code&gt;pages_read_engagement&lt;/code&gt; and &lt;code&gt;pages_manage_posts&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K1hBktG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hyj4ezixhqe2u21ojvv4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K1hBktG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hyj4ezixhqe2u21ojvv4.png" alt="" width="593" height="461"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Get Forever User Token and save it in .env file
&lt;/h2&gt;

&lt;p&gt;Open &lt;code&gt;https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&amp;amp;client_id=$app_id&amp;amp;client_secret=$app_secret&amp;amp;fb_exchange_token=$short_user_token&lt;/code&gt; and get your forever user token (change app_id, app_secret and short_user_token)&lt;br&gt;
You can use browser or some simple func&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getForeverUserToken&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//this values I'm getting from .env file.&lt;/span&gt;
    &lt;span class="nv"&gt;$app_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.facebook.client_id'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$app_secret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.facebook.client_secret'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$short_user_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.facebook.short_token'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nv"&gt;$ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_RETURNTRANSFER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&amp;amp;client_id=&lt;/span&gt;&lt;span class="nv"&gt;$app_id&lt;/span&gt;&lt;span class="s2"&gt;&amp;amp;client_secret=&lt;/span&gt;&lt;span class="nv"&gt;$app_secret&lt;/span&gt;&lt;span class="s2"&gt;&amp;amp;fb_exchange_token=&lt;/span&gt;&lt;span class="nv"&gt;$short_user_token&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;curl_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;die&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Error: "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nb"&gt;curl_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;isset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;die&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Error: "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"access_token"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Post your message
&lt;/h2&gt;

&lt;p&gt;To post to facebook page, we will need &lt;strong&gt;Page Access Token&lt;/strong&gt;. Duration of this token is 60 days, but can be changed anytime. In this example, we generate a new token everytime, but you can save it for some time if you're bulk posting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FacebookPost&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getPageAccessToken&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$pageId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.facebook.page_id'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$forever_user_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.facebook.admin_token'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nv"&gt;$ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"https://graph.facebook.com/&lt;/span&gt;&lt;span class="nv"&gt;$pageId&lt;/span&gt;&lt;span class="s2"&gt;?fields=access_token&amp;amp;access_token=&lt;/span&gt;&lt;span class="nv"&gt;$forever_user_token&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_RETURNTRANSFER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;die&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Error: "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nb"&gt;curl_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;isset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;die&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Error: "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"access_token"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;postMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;?string&lt;/span&gt; &lt;span class="nv"&gt;$link&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$page_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;getPageAccessToken&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nv"&gt;$pageId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'services.facebook.page_id'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'access_token'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$page_token&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="c1"&gt;//if we post link, include it&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$link&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'link'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$link&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nv"&gt;$ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_init&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://graph.facebook.com/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$pageId&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/feed"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_POST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_POSTFIELDS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;http_build_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_RETURNTRANSFER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nb"&gt;curl_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On facebook you can read more details and how to post photos or videos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developers.facebook.com/docs/pages/access-tokens/"&gt;How to get access token&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.facebook.com/docs/pages/publishing"&gt;How to post to page using your page access token&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>php</category>
      <category>facebook</category>
      <category>api</category>
    </item>
    <item>
      <title>redirect twitter to nitter online</title>
      <dc:creator>auct</dc:creator>
      <pubDate>Fri, 11 Nov 2022 13:12:21 +0000</pubDate>
      <link>https://forem.com/auct/redirect-twitter-to-nitter-online-k39</link>
      <guid>https://forem.com/auct/redirect-twitter-to-nitter-online-k39</guid>
      <description>&lt;p&gt;&lt;a href="https://nitter.auct.eu/"&gt;https://nitter.auct.eu/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've got bored on phone manually replacing twitter urls with nitter.&lt;/p&gt;

&lt;p&gt;I've created it just for myself, but maybe it will help someone else.&lt;/p&gt;

&lt;p&gt;Source code: &lt;a href="https://github.com/AucT/nitter-redirect"&gt;https://github.com/AucT/nitter-redirect&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>twitter</category>
    </item>
    <item>
      <title>What is the best way to search full name in MySQL (1m rows)?</title>
      <dc:creator>auct</dc:creator>
      <pubDate>Fri, 27 Apr 2018 12:24:32 +0000</pubDate>
      <link>https://forem.com/auct/what-is-the-best-way-to-search-full-name-in-mysql-1m-rows-338h</link>
      <guid>https://forem.com/auct/what-is-the-best-way-to-search-full-name-in-mysql-1m-rows-338h</guid>
      <description>&lt;p&gt;Hi. I need some help. Currently I have elastic search but it is very annoying (needs lots of ram, shutdowns everytime), So I want to get rid of it and get back to mysql search.&lt;br&gt;
I have table with 1m rows.&lt;br&gt;
Searchable columns: name, name_original (ofthen blank). Both of them are 2-3 words each, varchar 255.&lt;/p&gt;

&lt;p&gt;How would you organize search?&lt;/p&gt;

</description>
      <category>sql</category>
      <category>mysql</category>
      <category>help</category>
    </item>
    <item>
      <title>3 reasons why using kotlin for unique article is bad idea</title>
      <dc:creator>auct</dc:creator>
      <pubDate>Tue, 14 Nov 2017 16:05:57 +0000</pubDate>
      <link>https://forem.com/auct/3-reasons-why-using-kotlin-for-unique-article-is-bad-idea-co7</link>
      <guid>https://forem.com/auct/3-reasons-why-using-kotlin-for-unique-article-is-bad-idea-co7</guid>
      <description>&lt;p&gt;&lt;del&gt;1&lt;/del&gt;3 reasons why using kotlin for unique article is bad idea:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Folks at android studio hasn't normal kotlin -&amp;gt; java converter&lt;/li&gt;
&lt;li&gt;Folks at android studio do have normal java -&amp;gt; kotlin converter&lt;/li&gt;
&lt;li&gt;Most of people that will read your next article are beginners &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The beginners who barely get into android java world, but wanted dat article, become frustrated.&lt;/p&gt;

&lt;p&gt;So your 3-5 files in kotlin without java alternative can ruin your tutorial and make beginners feel ashamed and lost once again (google are terrible on documentation and showing examples; and the most well made courses on internet shows how to make hello world app).&lt;/p&gt;

&lt;p&gt;Let's make android fun &lt;del&gt;again&lt;/del&gt; at last by providing java alternative!&lt;/p&gt;

</description>
      <category>android</category>
    </item>
    <item>
      <title>Are dislikes dead nowadays?</title>
      <dc:creator>auct</dc:creator>
      <pubDate>Sat, 14 Oct 2017 07:14:47 +0000</pubDate>
      <link>https://forem.com/auct/are-dislikes-dead-nowadays-d11</link>
      <guid>https://forem.com/auct/are-dislikes-dead-nowadays-d11</guid>
      <description>&lt;p&gt;Hi! I'm thinking a lot about social functionality for my future project and I don't know when do you need dislike button for comment, post, etc?&lt;/p&gt;

&lt;p&gt;Services with dislikes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;youtube comments, videos
&lt;/li&gt;
&lt;li&gt;reddit comments and posts&lt;/li&gt;
&lt;li&gt;disqus comments&lt;/li&gt;
&lt;li&gt;blizzard forum&lt;/li&gt;
&lt;li&gt;imdb reviews&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Services without&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;facebook (reactions)&lt;/li&gt;
&lt;li&gt;google plus (plus sign)&lt;/li&gt;
&lt;li&gt;medium (clap)&lt;/li&gt;
&lt;li&gt;xenforo cms (thanks)&lt;/li&gt;
&lt;li&gt;playmarket reviews (like)&lt;/li&gt;
&lt;li&gt;other 99% of social networks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I thought dislike functionality was trending in old days but while checking info about  reddit, youtube were created in 2005, disqus in 2007, but facebook also was that early and it doesn't have it.&lt;/p&gt;

&lt;p&gt;Also in my research I found out that almost all old websites with user reviews has like and dislikes (imdb, etc) but new ones like playstore has only like and report (report is not visible).&lt;/p&gt;

&lt;p&gt;Nowadays it seems nobody cares about dislikes, except old review websites and old comment systems. I can see trend in favor new facebook reactions and renaming likes to hearts (twitter, instagram, etc) / claps (medium) / plus sign (gplus).&lt;/p&gt;

&lt;p&gt;btw I don't get why a lot of websites allow to upvote your own comment or reddit publication.&lt;/p&gt;

&lt;p&gt;So are dislikes dead? And when you must have it? Is there a golden rule when do or not you must have this?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
