Comments (7)
No problem! Glad I could help you
from share2fedi.
Hello, could you provide a bit more information? What is the example text you are trying to post, and what is the toot's and Mastodon instance URL? Also, what browser and OS are you on?
I have tried it right now, and for me, it still works fine π€
from share2fedi.
I am trying to use your service through a plugin written in Python.
I use the following string (example):
f"https://toot.kytta.dev/?text={title}{LF}{url}{LF}{hashtags}"
and - before this instruction - I defined
LF = '\n'
from share2fedi.
Tested also the method
import os
and then
f"https://toot.kytta.dev/?text={title}{os.linesep}{url}{os.linesep}{hashtags}"
without success
from share2fedi.
I use the following string (example):
f"https://toot.kytta.dev/?text={title}{LF}{url}{LF}{hashtags}"
and - before this instruction - I defined
LF = '\n'
I think the problem is that your newline character is not URL encoded. For example, you can't put whitespaces in URLs, you have to replace them with %20
. For a newline, that would be %0D%0A
I suggest you change your script a little bit as follows:
from urllib.parse import urlencode
query = urlencode({
"text": f"{title}{LF}{url}{LF}{hashtags}"
})
url = f"https://toot.kytta.dev/?{query}"
from share2fedi.
Tested also the method
import os
and then
f"https://toot.kytta.dev/?text={title}{os.linesep}{url}{os.linesep}{hashtags}"
without success
And I wouldn't use os.linesep
in this case. os.linesep
is meant for files stored on different filesystems in different OSes: on Windows, it's CRLF, but on Unix-based OSes, it's LF. On the Web, however, it's the same everywhere, and you can just use \n
from share2fedi.
Works perfectly!
The problem was actually my poor Python knowledge.
Please apologize...
from share2fedi.
Related Issues (20)
- Fix LanguageTool inserting a ghost element in `<body>`
- JavaScript needed to toot
- Add description to the `<title>` and the page itself
- Add self-hosting instructions to README HOT 4
- Handle overlong toots HOT 5
- Change project's name to Share2Fedi
- Support more services HOT 4
- Add privacy policy to the page
- Add footer link to the stats
- Add footer link to the status page
- Save multiple instances HOT 1
- Encourage people to deploy their own instances HOT 1
- Support Pleroma
- Allow self-hosters to update the hosting metadata
- cant start server, missing file HOT 1
- too recent node.js verison required HOT 1
- Managing Share2Fedi via a systemd unit. HOT 1
- Remove translation CLA HOT 1
- Deno version does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from share2fedi.