V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
griabcrh
V2EX  ›  生活

每天上班打开浏览器看到必应的背景图片就很舒心

  •  
  •   griabcrh · 2019-03-25 09:10:02 +08:00 · 4991 次点击
    这是一个创建于 1831 天前的主题,其中的信息可能已经有所发展或是发生改变。
    19 条回复    2019-03-29 15:19:14 +08:00
    hacunix
        1
    hacunix  
       2019-03-25 09:17:25 +08:00 via iPhone
    andylsr
        2
    andylsr  
       2019-03-25 09:17:57 +08:00 via Android
    +1
    KamenReborn
        3
    KamenReborn  
       2019-03-25 09:18:33 +08:00 via Android
    每天上班打开电脑看到老婆也很舒心
    hirasawayui
        4
    hirasawayui  
       2019-03-25 09:18:56 +08:00
    每天上班打开电脑看到老婆也很舒心
    ismyyym
        5
    ismyyym  
       2019-03-25 09:29:16 +08:00
    我写了个脚本,每天更换桌面壁纸成 bing 的背景图。
    Nasei
        6
    Nasei  
       2019-03-25 09:36:12 +08:00 via Android
    win10 商店里有个应用叫 老司機鎖屏
    passerbytiny
        7
    passerbytiny  
       2019-03-25 09:50:17 +08:00
    griabcrh
        8
    griabcrh  
    OP
       2019-03-25 11:09:56 +08:00
    @hacunix @andylsr @KamenReborn @hirasawayui @ismyyym @Nasei @passerbytiny 每个人心里都有一个美好的 dream
    griabcrh
        9
    griabcrh  
    OP
       2019-03-25 11:10:25 +08:00
    @ismyyym 方便的话脚本可以发我一个不?
    Alexhohom
        10
    Alexhohom  
       2019-03-25 11:19:45 +08:00
    windows 应用商店有一个 Dynamic theme 软件,可以设置自动更新 bing 壁纸和 windows 聚焦壁纸,同时还可以修改锁屏界面。
    zst
        11
    zst  
       2019-03-25 11:25:35 +08:00 via Android
    @ismyyym 同求脚本(づ ̄ ³ ̄)づ
    zxcvsh
        12
    zxcvsh  
       2019-03-25 12:50:07 +08:00 via iPhone
    我比较喜欢 steam 里面那个啥软件
    biabia123456
        13
    biabia123456  
       2019-03-25 13:07:20 +08:00

    小程序版
    Greendays
        14
    Greendays  
       2019-03-25 13:35:36 +08:00
    一天的摸鱼开始了
    Osk
        15
    Osk  
       2019-03-25 14:00:23 +08:00
    powershell 下载并设置为桌面壁纸的 jio 本, 大概只支持 Windows 10, Windows 7 可能需要升级 Powershell, 异常处理什么的不存在的...

    另存成 .ps1 文件, 右键运行即可, 可能需要修改 ps 执行策略:


    Write-Host -ForegroundColor Red "下载 bing 每日壁纸"

    # set save directory
    $saveDir = Join-Path -Path ([Environment]::GetFolderPath('myPictures')) -ChildPath '必应壁纸'
    New-Item -ItemType Directory -Path $saveDir -ErrorAction Ignore

    # fetch URL
    $bingHost = "https://www.bing.com"
    $bingImageApi = $bingHost + "/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=zh-CN"

    # invoke web request
    $bingImage = (irm -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer) -Uri $bingImageApi).images[0]
    # gather image infomation
    $imageCopyright = $bingImage.copyright

    if ($bingImage.url -cmatch '^https*://') {
    $imageUrl = $bingImage.url
    } else {
    $imageUrl = $bingHost + $bingImage.url
    }
    # get local file name
    if (($bingImage.url) -match 'id=OHR\.(?<imageName>.+?)&.*') {
    $saveName = $Matches.imageName
    } else {
    $saveName = 'Bing-' + $(Get-Date -UFormat '%y%m%d') + '.jpg'
    }

    # Download
    $savePath = (Join-Path -Path $saveDir -ChildPath $saveName)
    Write-Host -ForegroundColor Green $imageUrl, '->', $savePath
    irm -Uri $imageUrl -OutFile $savePath

    # set Windows desktop wallpaper
    # Win32 API
    $win32ApiSignature = @"
    [DllImport("user32.dll", CharSet = CharSet.Unicode)]
    public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, string pvParam, uint fWinIni);
    "@

    $User32 = Add-Type -MemberDefinition $win32ApiSignature -Name 'User32' -Namespace 'Win32' -PassThru
    # Set wallpaper
    $User32::SystemParametersInfo(0x0014, 0, $savePath, 0x0001)

    # 暂停, 可以注释掉
    Read-Host



    目测 v2 的排版会跪, 幸好不是 python
    waiaan
        16
    waiaan  
       2019-03-25 16:41:57 +08:00 via Android
    R1nG
        17
    R1nG  
       2019-03-25 16:43:05 +08:00
    贴个每天抓取必应壁纸的网址: https://www.r1ng.net/Project/wallpaper/
    xiaoyang7545
        18
    xiaoyang7545  
       2019-03-26 17:41:42 +08:00
    实在太花。
    madaha0
        19
    madaha0  
       2019-03-29 15:19:14 +08:00
    好看是好看,有些是花里胡哨的,当锁屏还行,当桌面有时候图标都看不清
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5285 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 09:13 · PVG 17:13 · LAX 02:13 · JFK 05:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.