<?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: Ankit Chachada</title>
    <description>The latest articles on DEV Community by Ankit Chachada (@ankitchachada).</description>
    <link>https://dev.to/ankitchachada</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%2F208357%2F644e7071-4924-43aa-89a2-3bcdcc8f13e3.jpeg</url>
      <title>DEV Community: Ankit Chachada</title>
      <link>https://dev.to/ankitchachada</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankitchachada"/>
    <language>en</language>
    <item>
      <title>Deleting repositories using Octokit</title>
      <dc:creator>Ankit Chachada</dc:creator>
      <pubDate>Wed, 07 Aug 2019 08:02:31 +0000</pubDate>
      <link>https://dev.to/ankitchachada/deleting-repositories-using-octokit-4dpp</link>
      <guid>https://dev.to/ankitchachada/deleting-repositories-using-octokit-4dpp</guid>
      <description>&lt;p&gt;I was trying to delete a few repositories from my GitHub account which had issues, but deleting one by one was cumbersome. Also, every time when you have to delete the repository, you have to type the repository name. So I googled and I found an amazing ruby gem &lt;a href="https://github.com/octokit/octokit.rb"&gt;octokit&lt;/a&gt; which helped me to delete the selected repositories. I would really love to get feedback on my code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'octokit'

client = Octokit::Client.new(:login =&amp;gt; 'USERNAME',
                             :password =&amp;gt; 'PASSWORD')
repo_hash = {}
client.repositories('USERNAME').each do |i|
 repo_hash[i["id"]] = i["name"] #collecting ID as key and name as value
end

#array of repositories I wanted to delete
repos = ["ABC","XYZ","PQR"]

del_repos = []
repos.each do |repo|
  del_repos &amp;lt;&amp;lt; repo_hash.key(repo) #delete_repository needs ID 
end

del_repos.each do |i|
  client.delete_repository(i)
end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>github</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
