dongyoulou4829 2015-10-02 09:11
浏览 84

PHP如何检查blogspot中删除的博客?

I want to check blog status, active or removed.

Active blog:
http://novisadcats.blogspot.com/  

Removed blog:
http://cityofangell.blogspot.com/

Removed blog, but available to register:
http://madhouseofporn.blogspot.com/

I am trying to use php get_headers(); I can check if that blog is active or removed, but how to check if blog status is removed but available to register?

Example Results:

Active blog:
$headers = get_headers("http://novisadcats.blogspot.com/");
echo $headers[12]; // HTTP/1.0 200 OK

Removed blog:
$headers = get_headers("http://cityofangell.blogspot.com/");
echo $headers[12]; // HTTP/1.0 404 Not Found

Removed blog, but available to regsiter:
$headers = get_headers("http://madhouseofporn.blogspot.com/");
echo $headers[12]; // HTTP/1.0 404 Not Found

Thanks for help...

  • 写回答

1条回答 默认 最新

  • dqn8235 2015-10-02 09:28
    关注

    You have 4 option(s)

    1. Check manually.
    2. Make an assumption that if an url returns 404 it may be available.
    3. You can try crawl the homepage and see if it returns an "Ok" when the domain has been entered. This can be done using a tool such as DomCrawler Component (http://symfony.com/doc/current/components/dom_crawler.html)
    4. The "hack"-ish way. Probably should not be done. Find the "URL" that Blogger requests when they check the domain availability (Google Chrome Developer tool, Network tracking) and try simulate the request from your end.

    However I would probably go ahead and ask Support about this, and ask if there is a way to check, or if any of the options above are okay to do.

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line