griabcrh
V2EX  ›  生活

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

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

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