You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: issue_2715_fix_broken_twitter_urls_job.rb
    path of file: ./repos/zammad/app/jobs
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

class Issue2715FixBro
    
  def fix_broken_links(article)
    type = Ticket::Article::Type.lookup(id: article.type_id).name

    article.preferences[:links]&.each do |link|
      link[:url] = case type
                   when 'twitter status'
                     STATUS_TEMPLATE % article.attributes.symbolize_keys
                   when 'twitter direct-message'
                     DM_TEMPLATE % article.preferences[:twitter].symbolize_keys
                   end
    end