Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Sri.Theo
Apr 16, 2008
Hi all, a bit of a weird one here. Someone called Tom Forth (@thomasforth) recently published this tool called parkulator which calculates the amount of land area used for car parks in an area, it's a really useful tool if you're interested in urban design, affordable housing or economics.

Unfortunately it doesn't calculate the amount of land used for on street parking as that's marked differently on Open Street maps. My first instinct was to mark out the areas I care about as shapes on Open Street map but it seems like that's not how they want to do it.

He has posted the source on GitHub and said others are welcome to submit changes.

Is it possible to amend the current code to also pull the data for on street parking as well?

Adbot
ADBOT LOVES YOU

Sri.Theo
Apr 16, 2008
Thanks both, that’s really helpful.

Sri.Theo
Apr 16, 2008
Is it possible to set up a script that will automatically move new downloads from my /Users/name/Downloads into /Users/name/OneDrive/5.Downloads and would someone help me? I want to do it this way as I won't have to change the settings in a bunch of individual apps and some don't work well with one demand folders.

Edit: This is on an up to date MacBook.

Sri.Theo
Apr 16, 2008

skull mask mcgee posted:

If you’re willing to spend a little money, Hazel is intended for this sort of thing. I use it myself for basically the same thing you want and it works perfectly.

You could also probably replace the Downloads folder with a symlink or alias to your OneDrive folder.

e: You can also make a "Folder Action" using Automator to accomplish this. It would look something like this:



45 USD is a little expensive for my needs but automator worked perfectly- thanks!

Sri.Theo
Apr 16, 2008
Is something that could take a OneNote file, on macOS, and export it to text files (maybe using Markdown) in structured folders (Notebook, Section, Pages) trivial or virtually impossible?

I've found a couple of projects that can do it, but one is Window's only and the other requires messing around with Azure directory in a way that looks tricky.

https://github.com/alxnbl/onenote-md-exporter
https://github.com/Danmou/onenote_export

Sri.Theo
Apr 16, 2008

nielsm posted:

You'd have to go looking for (or write from scratch) an implementation of the file format (documented here) to make a platform-agnostic exporter, that also isn't dependent on other locally installed software or the data being on OneDrive.

…which sounds well outside the realm of ‘request a tiny app’. Thanks for the information though, I’ll try and get the second option to work

Sri.Theo
Apr 16, 2008
Any interest in creating a command-line app that extracts all the text from a tweet and its replies and saves them to a .txt document?

It's the type of thing that would be useful for saving book recommendations etc. Would also be useful to have options for deleting duplicate lines, saving usernames etc. Although, I get the feeling that there may be API shenanigans that make this complex.

Adbot
ADBOT LOVES YOU

Sri.Theo
Apr 16, 2008

nexxai posted:

This python code won't do exactly what you're looking for but with a little tweaking and a nested loop, it could.

Right now, it gets the last 20 tweets from USERNAME and dumps them to the screen. It shouldn't take too much effort to modify it to also pull the ID of the tweet and recursively loop through the tree.

[EDIT] It also ignores tweets that have a link in them (the if 't.co' part; it's Twitter's link shortener). That condition can just be removed if we don't want to ignore those tweets.

code:
import snscrape.modules.twitter as sntwitter
import os

# Creating list to append tweet data to
tweets_list2 = []

# Using TwitterSearchScraper to scrape data and append tweets to list
for i, tweet in enumerate(sntwitter.TwitterSearchScraper('from:USERNAME').get_items()):
    if i > 20:
        break
    if 't.co' not in tweet.content:
        tweets_list2.append(tweet.content)

for tweet in tweets_list2:
    input = input + tweet + "\n\n\n\n"

os.system('clear')
print(input)

Thanks so much. I've been trying to get this to work but keep getting an error "SyntaxError: unexpected character after line continuation character". Is there anything I'm supposed edit about from username? I've tried both '@borisjohnson' and 'borisjohnson' for example and get the same error.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply