![]() ![]() # This means find the first element which has the class "recipe-title" # This tells BeautifulSoup to parse the htmlĬontent = BeautifulSoup(f, "html.parser") # So we use the requests package to get the url this extension is # Pythonista cannot (or does not offer) getting the contents of a # This gets the URL this extension is called on Print('Running in Pythonista app, using test data.\n') # appex is the package which contains all the logic for being a share # This is mostly copied from the URL Extension template from Pythonista # enumerate gives us every item in a list and it's index # python figures out this is a String, so it will only allow you to # it can then be used anywhere inside this function (def()) # f-strings allow you to insert variables inside of strings # types of variables are not explicit in python, but they are enforced, Return unicodedata.normalize("NFKD", txt.get_text().strip()) # Found this online, NYTimes includes '\xa0' which is raw ascii ' ' Hopefully it will be a good reference! import clipboard I've included my script with a lot of comments. But, I encourage you to learn it! Perhaps it’s an answer to doing the same action as you’ve done here on your Mac. So, while you can use it to learn python, it would be very difficult to use without knowing python. Pythonista is just an editor for python with automation capabilities. Pythonista includes a package BeautifulSoup which makes it pretty easy to grab elements from html. And, of course, just like the rest of the site, pushing to GitHub triggers the build and redeploy.I needed to be able to parse html. Adding my photos to Working Copy, is then a matter of selecting the Shortcut from the share sheet in photos, instead of exporting directly to Working Copy. Numbering the files correctly on export does take a little more work however and, for this, I use Shortcuts: with a simple workflow, it's possible to rename files sequentially, and then prompt the user for a location to save them. Using Working Copy, it's easy to manually create this directory structure and Markdown file-I only need to do this once for each album so it doesn't represent significant effort. A sidecar Markdown index file contains the album metadata. When it comes to storing media in my site, the approach I take is very pragmatic: folders are created for the year, month, and album, and the corresponding photos and movies live there, sorted by date, and numbered sequentially. Since starting this post, I've also been experimenting with iA Writer for dedicated Markdown editing and offline previews. Photos and Shortcuts for managing and exporting photos.Safari and Split Screen for live previews while editing.Working Copy for editing content and templates.For this, I make use of a few apps and workflows: With an automated build and deploy process like this in place, publishing becomes all about efficiently managing a git repository of Markdown files. : To be precise, I'm using Frontmatter which includes some additional yaml-formatted metadata such as the page title, date, keywords, etc. While I use a homegrown solution for this process, it's a very common approach: GitHub Pages offers this behaviour out-of-the-box with Jekyll and it's a great place to start. Whenever a change is pushed, it’s built and deployed automatically. The site itself is stored in GitHub as a collection of Markdown and media files-one per page. Now that it’s all working, I’ve been asked to describe my workflow, and the tools I use. Over the past couple of years, I have been slowly working towards using iOS exclusively to update my website-it’s liberating being able to publish posts and photos with just an iPhone or iPad. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |