<?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>DEV Community: Eva</title>
    <description>The latest articles on DEV Community by Eva (@ewasion).</description>
    <link>https://dev.to/ewasion</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%2F33122%2F0e22a084-af42-4399-a88f-a74090052db8.png</url>
      <title>DEV Community: Eva</title>
      <link>https://dev.to/ewasion</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ewasion"/>
    <language>en</language>
    <item>
      <title>The day I broke Gab.ai</title>
      <dc:creator>Eva</dc:creator>
      <pubDate>Wed, 13 Sep 2017 08:11:54 +0000</pubDate>
      <link>https://dev.to/ewasion/the-day-i-broke-gabai</link>
      <guid>https://dev.to/ewasion/the-day-i-broke-gabai</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;As a social network, &lt;a href="https://gab.ai"&gt;Gab&lt;/a&gt; is trash... but a great way to learn from other people's mistakes, and that's what this post is all about!&lt;br&gt;
They have a JSON API (only used internally, they don't talk about it anywhere) for basically everything, and most things are not rate limited.&lt;br&gt;
Obviously, I wanted to see what I can do.&lt;/p&gt;

&lt;h2&gt;
  
  
  The beginning
&lt;/h2&gt;

&lt;p&gt;Once I wrote PHP functions for everything the API had to offer, I made a simple bot that would take the messages people sent, passed them through Cleverbot and posted the answer...&lt;br&gt;
Until it wasn't working anymore, my IP was blocked from viewing my notifications. Forever.&lt;br&gt;
I thought about all the bot accounts that followed me as soon as I created my account. They probably don't limit when you follow people!&lt;br&gt;
And turns out they don't. And looking at your timeline isn't limited. My plan: Follow every single user and look at my timeline to see if anyone mentioned the bot.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mess
&lt;/h2&gt;

&lt;p&gt;I set it up so my bot follows about 100 users every 5 minutes, I looked at my follow count from time to time then went to bed.&lt;br&gt;
2 March 2017, Gab is having trouble loading, other people are starting to report the problems, I just think they are getting ddossed by some skid.&lt;br&gt;
The next day, everyone was getting 502 or 504 errors, meaning we could not message &lt;a href="https://gab.ai/support"&gt;@support&lt;/a&gt; to ask what was going on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The aftermath
&lt;/h2&gt;

&lt;p&gt;After a week or so, everything was back to normal.&lt;br&gt;
I went to tweak some things on my bot, but the account disappeared, that's when I realised I was probably the cause of this.&lt;br&gt;
It followed 145k accounts at a slow pace, and all it was doing was check its timeline like a normal user would.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lessons learned: check if your whole website can be killed by simply following a lot of people, limit your API even if you think you will be the only one using it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: This can still be done, it doesn't look like they fixed anything.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>gab</category>
      <category>social</category>
      <category>media</category>
      <category>network</category>
    </item>
  </channel>
</rss>
