V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
griabcrh
V2EX  ›  生活

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

  •  
  •   griabcrh · Mar 25, 2019 · 6023 views
    This topic created in 2591 days ago, the information mentioned may be changed or developed.
    19 replies    2019-03-29 15:19:14 +08:00
    hacunix
        1
    hacunix  
       Mar 25, 2019 via iPhone
    andylsr
        2
    andylsr  
       Mar 25, 2019 via Android
    +1
    KamenReborn
        3
    KamenReborn  
       Mar 25, 2019 via Android
    每天上班打开电脑看到老婆也很舒心
    hirasawayui
        4
    hirasawayui  
       Mar 25, 2019
    每天上班打开电脑看到老婆也很舒心
    ismyyym
        5
    ismyyym  
       Mar 25, 2019
    我写了个脚本,每天更换桌面壁纸成 bing 的背景图。
    Nasei
        6
    Nasei  
       Mar 25, 2019 via Android
    win10 商店里有个应用叫 老司機鎖屏
    passerbytiny
        7
    passerbytiny  
       Mar 25, 2019
    griabcrh
        8
    griabcrh  
    OP
       Mar 25, 2019
    @hacunix @andylsr @KamenReborn @hirasawayui @ismyyym @Nasei @passerbytiny 每个人心里都有一个美好的 dream
    griabcrh
        9
    griabcrh  
    OP
       Mar 25, 2019
    @ismyyym 方便的话脚本可以发我一个不?
    Alexhohom
        10
    Alexhohom  
       Mar 25, 2019
    windows 应用商店有一个 Dynamic theme 软件,可以设置自动更新 bing 壁纸和 windows 聚焦壁纸,同时还可以修改锁屏界面。
    zst
        11
    zst  
       Mar 25, 2019 via Android
    @ismyyym 同求脚本(づ ̄ ³ ̄)づ
    zxcvsh
        12
    zxcvsh  
       Mar 25, 2019 via iPhone
    我比较喜欢 steam 里面那个啥软件
    biabia123456
        13
    biabia123456  
       Mar 25, 2019

    小程序版
    Greendays
        14
    Greendays  
       Mar 25, 2019
    一天的摸鱼开始了
    Osk
        15
    Osk  
       Mar 25, 2019
    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  
       Mar 25, 2019 via Android
    R1nG
        17
    R1nG  
       Mar 25, 2019
    贴个每天抓取必应壁纸的网址: https://www.r1ng.net/Project/wallpaper/
    xiaoyang7545
        18
    xiaoyang7545  
       Mar 26, 2019
    实在太花。
    madaha0
        19
    madaha0  
       Mar 29, 2019
    好看是好看,有些是花里胡哨的,当锁屏还行,当桌面有时候图标都看不清
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5694 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 07:46 · PVG 15:46 · LAX 00:46 · JFK 03:46
    ♥ Do have faith in what you're doing.