How to get full name of specific Subreddit of Reddit - ios

Presently, I am working on Reddit app. A user can subscribe or unsubscribe from my app which will reflect to the respective account as well.
I am using ReddKit.
Now, I am stuck in getting a subreddit Full name field which is required to subscribe or unsubscribe by calling subscribeToSubredditWithFullName method. But, I am not able to extract Full Name from the response as an identifier error is being returned.
Response = "RKSubreddit: 0x7******60, full name: t5_***eq, name: politics"
Can anybody help in getting the Full Name of a subreddit?
Is there any other way to subscribe to a subreddit ?

After working on Reddkit, I found the answer that we can call "linksInSubredditWithName" method and if we need sub-reddit "full name" then it will be available in RKLink.h which will be accessible by an object of RKLink.

Related

readMask value to get the display names form new GMB API

I am running this line of code:
location_list = self.service_mbbi_v1.accounts().locations().list(parent=account_name,readMask='name').execute()
And I get the list of the location IDs but I don't manage to get the Location display name, the display name, not just the ID. I wrote google and told them about my issue and they told me they are looking into it but it has been 2 weeks and no response yet. So just wanted o see if someone else had the same issue and if they fpund a solution or a workaround.
The documentation provides only an example, not a list of possible values:
https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations/list
And even when I try the example value of the readMask flag I get an error:
[{'#type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'read_mask', 'description': 'Invalid field mask provided'}]}]">
I found this similar question:
Google Business Profile API readMask
The example they provide work for me but I still can't get the display name value.
I thought of using the google place ID I get from the metadata response and see if I can use another API to find the name but it feels they should be a proper 'readMask' string vale for the display name here and it is not 'displayName'..
Has anyone a hint of what can I do?
Thanks a lot
If you are trying to get the business name data, your readMask should be 'title'.

Zapier - Zap, How to call an Action on a list one by one

I'm configuring a zap which does the following:
Get a list of emails from an API endpoint.
Subscribe each record to Mailchimp
My problem here is that the subscriber email takes in a list of emails and this returns the following error message:
Bargle. We hit an error creating a subscriber. :-( Error: Invalid
Resource - Please provide a valid email address.
This is because Mailchimp aparently doesn't allow multple subscriptions in one single form.
So my question is, is there a way to perform an action per element in the list ?
Some sort of
emailList.foreach(function(email){
performAction(email);
})
Note that I cannot use the cli, is this possible with some sort of funnel action in zapier or maybe using the scrpting ?
Thanks
David here, from the Zapier Platform team.
By default, when a trigger returns a top-level list of objects, subsequent actions occur for each. I'm not sure what type of trigger you're working with, but make sure it returns an object like this:
return [{email: 'email1#gmail.com'}, {email: 'email2#gmail.com'}, {email: 'email3#gmail.com'}]
and it should work as expected.

Can you upload a file to the Slack API using files.upload as a different user?

I'm trying to find a way to have an application post a text snippet to our support channel through the Slack API. Using the files.upload method, I can create a text snippet and share it with the channel, but the post appears to come from me (because the token used to authenticate the request is mine).
I'm looking for a way to do this, but make it appear with a custom user name and icon, like you can with the chat.postMessage method's username and icon_url parameters. Is there a way to achieve this?
There are two ways.
Way 1. - If you only want to upload in a channel and don't need to listen to any conversation, then you can use incoming-webhooks. And then override the username and icon. Read "Customizing your username and icon" in Here.
Way 2 - You can create a bot user and let the bot user type post this message for you. I guess right now you are using test tokens generated by Slack so you are getting your name only. But if you use bot-user then you can use custom Name and icon_url for your bot.
I hope this answers your question.
Yes, as #Abhinav Rai suggested, you need have bot. Slack support just answered me the same question.
To upload files as a bot you'll need to create an associated 'bot user' and post the file using the bot's token: https://api.slack.com/bot-users — all files must be owned by a user account and the bot user will fill this requirement.
There is a way 3 which uses the username function from chat.postMessage function. Follow this -
import slack
import json
import os
def pureimg(data1):
data1 = '[{"text": "", "image_url": "'+data1+'"}]'
data1 = [json.loads(data1[1:-1])]
return data1
#This function will make the image url to correct format.
slacker = slack.WebClient(token='your-token-here')
payoff=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'filename.png')
#It gives cross OS compatibility on filepath.
response=slacker.files_upload(channel='#theta',file=payoff)
payoff=response['file']['permalink']
#First We upload the local file to Slack and fetch permalink.
#If you do not have any local file just put the external image URL in the payoff.
response=slacker.chat_postMessage(channel='#channel_name', text="Sample Text", username='Bot name', attachments=pureimg(payoff), icon_emoji=':emoji:')
#Then, We post to Slack Channel as a bot!

verifying a single attendee with email

Is there a method to return a specific attendee's information by sending:
1) the attendee's email address
2) my user_key
3) my app_key
I could do this by searching the returned xml from this "event_list_attendees" method, however, I would prefer to only receive the one result (not hundreds for each call).
Note: I work on the platform team at Eventbrite
Currently there is no way to search for a specific attendee with event_list_attendees.
However, you can cut down on the amount of data returned by paging through the results until you have found the attendee or using the modified_after parameter if you know when the user was last updated: http://developer.eventbrite.com/doc/events/event_list_attendees/
I realize this limitation is non-ideal. We're actively working on building a new API which is more RESTful and does not have issues like this.

how do i get multiple twitter name using API querystring?

HI,how do i get multiple twitter name using API querystring,exmaple i need to populate related with the name of 'john'.how can i do that here i have one example below
'http://search.twitter.com/search.atom?q=from%3Ajohn' by this example we can see only particular user name only but i want related name.Kindly let me know ASAP.
You can use the OR operator...
http://search.twitter.com/search.atom?q=from%3ADWRoelands+OR+from%3AJohn

Resources