I need a way to define words in a rails project - ruby-on-rails

To clarify: I want to pass a word/phrase into a function and check whether it has a dictionary definition.
Any open source dictionary api/library that might be help? I was looking at wordnik but they seem to require an api key and for whatever reason, it hasn't been emailed to me.

You can find your Wordnik API key on your user settings page: Wordnik.com/users/edit (it's all the way at the bottom)

Related

Hardcoded urls : Refactor your code to get this URI from a customizable parameter

Best way to save hardcode values?
1) Plist
2) dictionary
According to me, plist is not the safest option because it is easily recoverable through IPA.
But if I store URL endpoints in Dictionary then I am getting Sonar Qube warnings. "Refactor your code to get this URI from a customizable parameter."
Keychain is the most secure place on the phone to store things. That doesn't mean it's unbreakable but less breakable as compare to others.
You can use a simple solution SAMKeychain, wrapper for the system keychain.

How to structure a GET request using HTTParty?

I am making a rails application that will make API calls to Eventbrite, using HTTParty.
I do not know how to structure my eventbrite.rb in my \lib directory file so that I can call it in my controller.
My eventbrite.rb file so far:
require 'HTTParty'
class EventBriteApi
def eventbrite
HTTParty.get()
end
end
The url I am sending a GET request to is something like this: www.eventbriteapi.com/v3/events/search?q=concert&sort_by=best&venue.city=san francisco
I already have an authorization token so I just need to know the format in which to structure my class, and how to actually make the right call in the controller, as well as how to grab the variables from the form in my view.
Thanks in advance.
Use existing API libraries for EventBrite, if you just want to learn, then its cool. The best way to learn is to see how others have done it.
https://github.com/ryanj/eventbrite-client.rb/blob/master/lib/eventbrite-client.rb
#^ Go through the code and see how he has done it.

How to know what are all the possible parameters for a query string for a site?

I want to check what are ALL the possible parameters for any existing website url. Assuming the site is working with parameters type query string "architecture" (and not MVC for example) something like:
http://www.foobar.com/p1&itemsPerPage=50&size=500
Let's say there are other parameters which I don't know exist, and I don't see them in the url at the moment. For example, parameters like max, day and OtherExoticVariable. Again, I don't know their names but want to know ALL of their names. Is there some way of requesting the server to respond will all possible url parameters?
I would prefer a method with Javascript that I could run quickly through a browser but could also do asp.net c# if necessary.
Thanks a lot!
Ray.
It is the script/app running on the server that decides what parameters are valid. Unless the app provides such a query mechanism you can't do it. The server has no idea what is valid and what isn't.
Not guaranteed to get you ALL query strings, but it is often helpful to Google
"foobar.com/p1& * ".
You will be able to see all the public occurrences of query strings for the foobar.com website.
(As the accepted answer says, there is no general method to access query strings unless the website provides an API.)
I do not think this is possible. Each Web application designer can decide on the parameters individually, and you only know them if you see them being used.

Any short URL service that you can POST variables on?

I work for a small SMS marketing company, where we're sending out text message that each contain a unique code for the user (as a variable). My url is rather long, and I want to attach a unique variable for each one.
For example, the full URL might be:
http://www.mybigwebsiteurlishuge.com/more/more/?code={variable}
but I want it to be something like:
http://bit.ly/2398h?code={variable}
Anybody know any services that can do this? Otherwise I need to purchase small domain name just for this.
Thanks so much!
Most shortening services have APIs that you can use to shorten your URLs. Including bit.ly. Yu will have to use their API to the shortened URL.
I kept on looking, and still couldn't find anything suitable, so I got a new 3-character domain name, and also make a redirecting script that changed miniaturized variable names t the full ones. This works just as good really.

Get watched issues in Redmine via REST API

We're looking to create a tool to help with time management in Redmine. The issue we are currently having is that we want to get a list of issues that are watched by a particular user but can't find an API for it. Does anyone know if this is possible or are we just going to have to try and modify Redmine directly?
SOLUTION: Similar to the solution provided below by dmf85, I found a solution to this problem that worked for me. The Issues API takes a query_id as one of its parameters. What I ended up doing was filtering my issues by Watcher (like dmf85 said) then saving the query. I then used the query_id from that saved custom query in my API call.
At least in Redmine 3.1, there’s an undocumented parameter for the Issues API that allows you to specify a watcher directly: watcher_id. It works just like assigned_to_id, you can pass either a user ID (i.e. watcher_id=23) or the special string me (i.e. watcher_id=me).
An example of URL could be like the following: https://example.com/redmine/issues.json?watcher_id=me&key=redmine_api_key
Under your issues tab in the interface, click:
add filter
watcher
select a watcher in the box
Then, click the atom, csv, or pdf link at the bottom for a link that you can write a program to consume at your discretion.
Does this help?

Resources