update_url.py 1.1 KB

1234567891011121314
  1. import dataset
  2. db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
  3. table=db['seo_nton_custurl']
  4. cust = "The Icons_ZH"
  5. url = ['https://www.setn.com/News.aspx?NewsID=1262828','https://news.tvbs.com.tw/health/2063873','https://money.udn.com/money/story/5635/7022520','https://tw.news.yahoo.com/%E6%AD%A3%E8%A6%96%E5%85%A8%E7%90%83%E9%AB%98%E9%BD%A1%E5%8C%96-%E5%AD%B8%E8%80%85%E5%96%8A-%E5%A3%AF%E4%B8%96%E4%BB%A3%E4%B9%8B%E6%98%A5-%E7%9A%84%E9%9D%A9%E5%91%BD-151459023.html','https://today.line.me/tw/v2/article/9mrVkax','https://today.line.me/tw/v2/article/oqNwkkW','https://m.life.tw/?app=view&no=1898066','https://times.hinet.net/news/24445618','https://n.yam.com/Article/20230310482125','https://www.owlting.com/news/articles/300146','https://www.watchmedia01.com/athematic-20230311045214.html','https://tw.nextapple.com/press/20230310/4908DCC46C0773A50372CAD6B3B8CF89?referralCode=5b50fa2f','https://www.windtalk.com.tw/article/detail?id=624','https://www.tnews.tw/article/detail?id=610']
  6. #print(cust, url)
  7. for u in url:
  8. if u != "" and cust != "":
  9. table.insert({'cust':cust,'url':u})
  10. else:
  11. print("Empty data")