{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Create counters summaries\n",
    "Create summaries of disinfo countermeasures for use in dataset cleaning etc."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing ../counter_tactics/ALcounters.md\n",
      "Writing ../counter_tactics/TA01counters.md\n",
      "Writing ../counter_tactics/TA02counters.md\n",
      "Writing ../counter_tactics/TA03counters.md\n",
      "Writing ../counter_tactics/TA04counters.md\n",
      "Writing ../counter_tactics/TA05counters.md\n",
      "Writing ../counter_tactics/TA06counters.md\n",
      "Writing ../counter_tactics/TA07counters.md\n",
      "Writing ../counter_tactics/TA08counters.md\n",
      "Writing ../counter_tactics/TA09counters.md\n",
      "Writing ../counter_tactics/TA10counters.md\n",
      "Writing ../counter_tactics/TA11counters.md\n",
      "Writing ../counter_tactics/TA12counters.md\n",
      "updated ../counter_tactic_counts.md\n",
      "Writing ../counters_metatag/cleaningcounters.md\n",
      "Writing ../counters_metatag/countermessagingcounters.md\n",
      "Writing ../counters_metatag/data pollutioncounters.md\n",
      "Writing ../counters_metatag/daylightcounters.md\n",
      "Writing ../counters_metatag/dilutioncounters.md\n",
      "Writing ../counters_metatag/diversioncounters.md\n",
      "Writing ../counters_metatag/frictioncounters.md\n",
      "Writing ../counters_metatag/metatechniquecounters.md\n",
      "Writing ../counters_metatag/reduce resourcescounters.md\n",
      "Writing ../counters_metatag/removalcounters.md\n",
      "Writing ../counters_metatag/resiliencecounters.md\n",
      "Writing ../counters_metatag/scoringcounters.md\n",
      "Writing ../counters_metatag/targetingcounters.md\n",
      "Writing ../counters_metatag/verificationcounters.md\n",
      "updated ../counter_metatag_counts.md\n",
      "Writing ../counter_resource/DHScounters.md\n",
      "Writing ../counter_resource/NGOcounters.md\n",
      "Writing ../counter_resource/activistscounters.md\n",
      "Writing ../counter_resource/adtechcounters.md\n",
      "Writing ../counter_resource/civil_societycounters.md\n",
      "Writing ../counter_resource/community_groupscounters.md\n",
      "Writing ../counter_resource/companiescounters.md\n",
      "Writing ../counter_resource/content_creatorscounters.md\n",
      "Writing ../counter_resource/data_scientistcounters.md\n",
      "Writing ../counter_resource/datastreamscounters.md\n",
      "Writing ../counter_resource/developerscounters.md\n",
      "Writing ../counter_resource/educatorscounters.md\n",
      "Writing ../counter_resource/elvescounters.md\n",
      "Writing ../counter_resource/factcheckerscounters.md\n",
      "Writing ../counter_resource/fundingcounters.md\n",
      "Writing ../counter_resource/gamesdesignerscounters.md\n",
      "Writing ../counter_resource/governmentcounters.md\n",
      "Writing ../counter_resource/government:policymakerscounters.md\n",
      "Writing ../counter_resource/influencerscounters.md\n",
      "Writing ../counter_resource/influencers:trusted_authoritycounters.md\n",
      "Writing ../counter_resource/infoseccounters.md\n",
      "Writing ../counter_resource/librariescounters.md\n",
      "Writing ../counter_resource/mediacounters.md\n",
      "Writing ../counter_resource/militarycounters.md\n",
      "Writing ../counter_resource/moneycounters.md\n",
      "Writing ../counter_resource/platform_admincounters.md\n",
      "Writing ../counter_resource/platform_admin:adtechcounters.md\n",
      "Writing ../counter_resource/platform_admin:fundingsitescounters.md\n",
      "Writing ../counter_resource/platform_admin:socialmediacounters.md\n",
      "Writing ../counter_resource/platform_algorithmscounters.md\n",
      "Writing ../counter_resource/platform_outreachcounters.md\n",
      "Writing ../counter_resource/platformscounters.md\n",
      "Writing ../counter_resource/publiccounters.md\n",
      "Writing ../counter_resource/public:account_ownerscounters.md\n",
      "Writing ../counter_resource/religious_organisationscounters.md\n",
      "Writing ../counter_resource/schoolscounters.md\n",
      "Writing ../counter_resource/server_admincounters.md\n",
      "updated ../counter_resource_counts.md\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>metatechnique</th>\n",
       "      <th>Title</th>\n",
       "      <th>Details</th>\n",
       "      <th>Playbook(s)</th>\n",
       "      <th>Resources needed</th>\n",
       "      <th>How found</th>\n",
       "      <th>References</th>\n",
       "      <th>Incidents</th>\n",
       "      <th>Tactic</th>\n",
       "      <th>Response</th>\n",
       "      <th>Techniques</th>\n",
       "      <th>NOTES</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>C00043</td>\n",
       "      <td>cleaning</td>\n",
       "      <td>Detect hijacked accounts and reallocate them</td>\n",
       "      <td>NaN</td>\n",
       "      <td>In all playbooks the platform must force user ...</td>\n",
       "      <td>platform_admin,activists,civil_society,money</td>\n",
       "      <td>2019-11-workshop</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA03 Develop People</td>\n",
       "      <td>D3 Disrupt</td>\n",
       "      <td>T0011 - Hijack accounts</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>C00053</td>\n",
       "      <td>cleaning</td>\n",
       "      <td>Delete old accounts / Remove unused social med...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Social media companies remove inactive account...</td>\n",
       "      <td>platform_admin,platform_admin:socialmedia,publ...</td>\n",
       "      <td>2019-11-workshop,2019-11-search</td>\n",
       "      <td>NaN</td>\n",
       "      <td>I00004</td>\n",
       "      <td>TA04 Develop Networks</td>\n",
       "      <td>D4 Degrade</td>\n",
       "      <td>T0011 - Hijack accounts\\nTA06 - Develop Conten...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>C00074</td>\n",
       "      <td>cleaning</td>\n",
       "      <td>Identify identical content and mass deplatform</td>\n",
       "      <td>\\n</td>\n",
       "      <td>In all cases some checks need to prevent depla...</td>\n",
       "      <td>platform_admin,platform_admin:socialmedia</td>\n",
       "      <td>2019-11-workshop</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA06 Develop Content</td>\n",
       "      <td>D2 Deny</td>\n",
       "      <td>T0022 - Conspiracy narratives\\nT0026 - Create ...</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>C00026</td>\n",
       "      <td>countermessaging</td>\n",
       "      <td>Shore up democracy based messages (peace, free...</td>\n",
       "      <td>Unsure</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2019-11-workshop</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA01 Strategic Planning</td>\n",
       "      <td>D4 Degrade</td>\n",
       "      <td>T0002 - Facilitate State Propaganda</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>C00082</td>\n",
       "      <td>countermessaging</td>\n",
       "      <td>Ground truthing as automated response to pollu...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2019-11-workshop</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA06 Develop Content</td>\n",
       "      <td>D3 Disrupt</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>C00214</td>\n",
       "      <td>metatechnique</td>\n",
       "      <td>Create policy that makes social media police d...</td>\n",
       "      <td>German model: facebook forced to police conten...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>government:policymakers</td>\n",
       "      <td>2019-11-workshop</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA07 Channel Selection</td>\n",
       "      <td>D3 Disrupt</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>C00215</td>\n",
       "      <td>metatechnique</td>\n",
       "      <td>Use fraud legislation to clean up social media</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>government:policymakers</td>\n",
       "      <td>2019-11-workshop</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA07 Channel Selection</td>\n",
       "      <td>D3 Disrupt</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>C00217</td>\n",
       "      <td>daylight</td>\n",
       "      <td>Registries alert when large batches of newsy U...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>platform_admin</td>\n",
       "      <td>grugq</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA07 Channel Selection</td>\n",
       "      <td>D2 Deny</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>C00218</td>\n",
       "      <td>removal</td>\n",
       "      <td>Censorship</td>\n",
       "      <td>Alter and/or block the publication/disseminati...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>platform_admin</td>\n",
       "      <td>grugq</td>\n",
       "      <td>Taylor81</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA09 Exposure</td>\n",
       "      <td>D2 Deny</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>C00219</td>\n",
       "      <td>daylight</td>\n",
       "      <td>Add metadata to content - out of the control o...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Add date and source to images</td>\n",
       "      <td>NaN</td>\n",
       "      <td>grugq</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>TA06 Develop Content</td>\n",
       "      <td>D3 Disrupt</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>186 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         ID     metatechnique  \\\n",
       "0    C00043          cleaning   \n",
       "1    C00053          cleaning   \n",
       "2    C00074          cleaning   \n",
       "3    C00026  countermessaging   \n",
       "4    C00082  countermessaging   \n",
       "..      ...               ...   \n",
       "181  C00214     metatechnique   \n",
       "182  C00215     metatechnique   \n",
       "183  C00217          daylight   \n",
       "184  C00218           removal   \n",
       "185  C00219          daylight   \n",
       "\n",
       "                                                 Title  \\\n",
       "0        Detect hijacked accounts and reallocate them    \n",
       "1    Delete old accounts / Remove unused social med...   \n",
       "2       Identify identical content and mass deplatform   \n",
       "3    Shore up democracy based messages (peace, free...   \n",
       "4    Ground truthing as automated response to pollu...   \n",
       "..                                                 ...   \n",
       "181  Create policy that makes social media police d...   \n",
       "182     Use fraud legislation to clean up social media   \n",
       "183  Registries alert when large batches of newsy U...   \n",
       "184                                         Censorship   \n",
       "185  Add metadata to content - out of the control o...   \n",
       "\n",
       "                                               Details  \\\n",
       "0                                                  NaN   \n",
       "1                                                  NaN   \n",
       "2                                                   \\n   \n",
       "3                                               Unsure   \n",
       "4                                                  NaN   \n",
       "..                                                 ...   \n",
       "181  German model: facebook forced to police conten...   \n",
       "182                                                NaN   \n",
       "183                                                NaN   \n",
       "184  Alter and/or block the publication/disseminati...   \n",
       "185                                                NaN   \n",
       "\n",
       "                                           Playbook(s)  \\\n",
       "0    In all playbooks the platform must force user ...   \n",
       "1    Social media companies remove inactive account...   \n",
       "2    In all cases some checks need to prevent depla...   \n",
       "3                                                  NaN   \n",
       "4                                                  NaN   \n",
       "..                                                 ...   \n",
       "181                                                NaN   \n",
       "182                                                NaN   \n",
       "183                                                NaN   \n",
       "184                                                NaN   \n",
       "185                      Add date and source to images   \n",
       "\n",
       "                                      Resources needed  \\\n",
       "0         platform_admin,activists,civil_society,money   \n",
       "1    platform_admin,platform_admin:socialmedia,publ...   \n",
       "2            platform_admin,platform_admin:socialmedia   \n",
       "3                                                  NaN   \n",
       "4                                                  NaN   \n",
       "..                                                 ...   \n",
       "181                            government:policymakers   \n",
       "182                            government:policymakers   \n",
       "183                                     platform_admin   \n",
       "184                                     platform_admin   \n",
       "185                                                NaN   \n",
       "\n",
       "                           How found References Incidents  \\\n",
       "0                   2019-11-workshop        NaN       NaN   \n",
       "1    2019-11-workshop,2019-11-search        NaN    I00004   \n",
       "2                   2019-11-workshop        NaN       NaN   \n",
       "3                   2019-11-workshop        NaN       NaN   \n",
       "4                   2019-11-workshop        NaN       NaN   \n",
       "..                               ...        ...       ...   \n",
       "181                 2019-11-workshop        NaN       NaN   \n",
       "182                 2019-11-workshop        NaN       NaN   \n",
       "183                            grugq        NaN       NaN   \n",
       "184                            grugq   Taylor81       NaN   \n",
       "185                            grugq        NaN       NaN   \n",
       "\n",
       "                      Tactic    Response  \\\n",
       "0        TA03 Develop People  D3 Disrupt   \n",
       "1      TA04 Develop Networks  D4 Degrade   \n",
       "2       TA06 Develop Content     D2 Deny   \n",
       "3    TA01 Strategic Planning  D4 Degrade   \n",
       "4       TA06 Develop Content  D3 Disrupt   \n",
       "..                       ...         ...   \n",
       "181   TA07 Channel Selection  D3 Disrupt   \n",
       "182   TA07 Channel Selection  D3 Disrupt   \n",
       "183   TA07 Channel Selection     D2 Deny   \n",
       "184            TA09 Exposure     D2 Deny   \n",
       "185     TA06 Develop Content  D3 Disrupt   \n",
       "\n",
       "                                            Techniques NOTES  \n",
       "0                              T0011 - Hijack accounts   NaN  \n",
       "1    T0011 - Hijack accounts\\nTA06 - Develop Conten...   NaN  \n",
       "2    T0022 - Conspiracy narratives\\nT0026 - Create ...   NaN  \n",
       "3                  T0002 - Facilitate State Propaganda   NaN  \n",
       "4                                                  NaN   NaN  \n",
       "..                                                 ...   ...  \n",
       "181                                                NaN   NaN  \n",
       "182                                                NaN   NaN  \n",
       "183                                                NaN   NaN  \n",
       "184                                                NaN   NaN  \n",
       "185                                                NaN   NaN  \n",
       "\n",
       "[186 rows x 13 columns]"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import generate_amitt_counters\n",
    "\n",
    "counter = generate_amitt_counters.Counter()\n",
    "counter.write_tactics_markdown()\n",
    "counter.write_metacounts_markdown()\n",
    "counter.write_resource_markdown()\n",
    "counter.dfcounters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
